Back to the Vavoom Forum Archives


Forum

ClearPlayer()

Wed, 24 May 2006 19:24:46

Crimson Wizard

I added new member to Player class of type reference to a custom class (I called it PlayerTeam). In function PutClientIntoServer() Player calls special function of MainGameInfo class that: 1) creates an object of type PlayerTeam and adds its reference into reference array (which is a member of MainGameInfo); 2) assigns that reference (of newly created object) to Player's reference, so that he may access that PlayerTeam object. But then function Player::Reborn() is called and it calls Object::ClearPlayer(self), which seems to erase value of reference mentioned above. So my questions are: 1) Is it normal? 2) Why is it so?
Thu, 25 May 2006 16:44:34

Janis Legzdinsh

Yes, it clears all fields in Player class. You must save/restore that reference same way reference to Bot is handled.

Back to the Vavoom Forum Archives