Hi, I'm using the following code to respawn players in a metamod plugin for Counter-Strike. It works wonderfully on windows but _crashes_ my linux server when I enter the command. Here's the code... any insight on why it could be doing this? -----David "BAILOPAN" Anderson
CBaseEntity *pPlayer = UTIL_PlayerByIndex(PlayerIndex); edict_t *player player = pPlayer->edict(); CBasePlayer *cbPlayer = (CBasePlayer *)pPlayer; if (!sPlayerValid(pPlayer)) return 0; if (pPlayer->pev->deadflag == ((DEAD_DYING)||(DEAD_DEAD)||(DEAD_RESPAWNABLE))) { //Note - I used this because respawn() gave me link errors even though I included client.h cbPlayer->Spawn(); pPlayer->pev->button = 0; cbPlayer->m_iRespawnFrames = 0; pPlayer->pev->nextthink = -1; }
maybe,maybe-not :
some windows OS spawn memory zeroed, and maybe the linux OS dont waste time zeroing the memory. More about: I suspect W9x windows systems not zeroed the allocations, so your mod will also crash at a W9x system. I think you can add more test conditions against null pointers in your code. ...
...Its pPlayer null?
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

