Hi,

Im trying to reuse TF2's teamplay roundbased code using latest SDK. I changed 
inheritance of sdk_gamerules to use the teamplay roundbased ones, and I added 
missing files (like teamplay_roundtimer, etc.). I'm having problem with strange 
crash happening in SetTimerInHud function:
void SetTimerInHUD( CBaseEntity *pTimer )
{
        m_iTimerToShowInHUD = pTimer ? pTimer->entindex() : 0;
}
The assigment of m_iTimerToShowInHUD fails with this stack frame (saying cannot 
read location 0x00000304):

        Server.dll!cmpBYTE(const void * lhs=0x00000304, const void * 
rhs=0x0012d4ec)  + 0x17 bytes      C
        Server.dll!memcmp(const void * lhs=0x00000304, const void * 
rhs=0x0012d4ec, unsigned int siz=4)  + 0x3b bytes   C
>       
> Server.dll!CNetworkVarBase<int,CBaseTeamObjectiveResource::NetworkVar_m_iTimerToShowInHUD>::Set(const
>  int & val=18)  Line 201 + 0xf bytes       C++
        
Server.dll!CNetworkVarBase<int,CBaseTeamObjectiveResource::NetworkVar_m_iTimerToShowInHUD>::operator=<int>(const
 int & val=18)  Line 191        C++
        Server.dll!CBaseTeamObjectiveResource::SetTimerInHUD(CBaseEntity * 
pTimer=0x0b1edc00)  Line 95  C++
        Server.dll!CTeamRoundTimer::SetActiveTimer(CTeamRoundTimer * 
pNewlyActive=0x0b1edc00)  Line 1349        C++
        Server.dll!CTeamRoundTimer::InputEnable(inputdata_t & input={...})  
Line 1267 + 0x9 bytes       C++
        Server.dll!CBaseEntity::AcceptInput(const char * 
szInputName=0x158ac9a8, CBaseEntity * pActivator=0x00000000, CBaseEntity * 
pCaller=0x00000000, variant_t Value={...}, int outputID=0)  Line 3777 + 0x12 
bytes  C++
        Server.dll!CTeamplayRoundBasedRules::CreateTimeLimitTimer()  Line 2073  
C++
        Server.dll!CTeamplayRoundBasedRules::RoundRespawn()  Line 2098  C++
        Server.dll!CTeamplayRoundBasedRules::State_Enter_PREROUND()  Line 1237 
+ 0x12 bytes     C++
        Server.dll!CTeamplayRoundBasedRules::State_Enter(gamerules_roundstate_t 
newState=GR_STATE_PREROUND)  Line 1099 + 0x21 bytes     C++
        
Server.dll!CTeamplayRoundBasedRules::State_Transition(gamerules_roundstate_t 
newState=GR_STATE_PREROUND)  Line 1078     C++
        Server.dll!CTeamplayRoundBasedRules::State_Think_STARTGAME()  Line 1225 
C++
        Server.dll!CTeamplayRoundBasedRules::State_Think()  Line 1122 + 0x21 
bytes      C++
        Server.dll!CTeamplayRoundBasedRules::Think()  Line 524  C++
        Server.dll!CSDKGameRules::Think()  Line 508     C++

Anyone has a clue? I tried few different things, but nothing works.

Also, Im wondering where CTeamObjectiveResource should be created. There is an 
extern ObjectiveResource() that gets automatically assigned to 
CTeamObjectiveResource in its constructor, but the class itself is never used. 
Is this defined in some part of missing TF code?

Thanks in advance
Emiel Regis

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to