Raised This Month: $ Target: $400
 0% 

FM_CmdStart and client_PreThink


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-09-2017 , 09:47   Re: FM_CmdStart and client_PreThink
Reply With Quote #5

https://github.com/dreamstalker/rehl....cpp#L777-L808
This is the difference in code. CmdStart is called at line 777, PlayerPreThink is called at 808.

The order is: CmdStart -> PlayerPreThink -> Think -> PlayerPostThink -> CmdEnd.

HLSDK Says:

  • Code:
    CmdStart
    
    We're about to run this usercmd for the specified player.  We can set up groupinfo and masking here, etc.
    This is the time to examine the usercmd for anything extra.  This call happens even if think does not.

  • Code:
    PlayerPreThink
    
    Called every frame before physics are run

  • Code:
    PlayerPostThink
    
    Called every frame after physics are run

  • Code:
    CmdEnd
    
    Each cmdstart is exactly matched with a cmd end, clean up any group trace flags, etc. here

Only Think (Not PreThink and PostThink) may not happen every frame.

Looks like game dll inspects button presses and does physics stuff in PreThink and advances animations and such on PostThink. My best guess is to do whatever you want related to button presses/physics in PlayerPreThink post-hook and totally avoid CmdStart, unless you need that usercmd_t pointer.

Last edited by klippy; 03-09-2017 at 09:50.
klippy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode