clean up votes when player is disconnected
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3529 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -994,6 +994,12 @@ void clearvote() { DELETEP(curvote); DELETEP(calledvote); }
|
||||
COMMANDN(callvote, scallvote, ARG_3STR); //fixme,ah
|
||||
COMMAND(vote, ARG_1INT);
|
||||
|
||||
void cleanplayervotes(playerent *p)
|
||||
{
|
||||
if(calledvote && calledvote->owner==p) calledvote->owner = NULL;
|
||||
if(curvote && curvote->owner==p) curvote->owner = NULL;
|
||||
}
|
||||
|
||||
void whois(int cn)
|
||||
{
|
||||
addmsg(SV_WHOIS, "ri", cn);
|
||||
|
||||
@@ -380,12 +380,14 @@ struct playerent : dynent, playerstate
|
||||
extern void detachsounds(playerent *owner);
|
||||
extern void removedynlights(physent *owner);
|
||||
extern void zapplayerflags(playerent *owner);
|
||||
extern void cleanplayervotes(playerent *owner);
|
||||
extern physent *camera1;
|
||||
extern void togglespect();
|
||||
removebounceents(this);
|
||||
detachsounds(this);
|
||||
removedynlights(this);
|
||||
zapplayerflags(this);
|
||||
cleanplayervotes(this);
|
||||
if(this==camera1) togglespect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user