setadmin 0 fix

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6742 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-12-29 10:15:20 +00:00
parent 744af34959
commit 994d5e0485
3 changed files with 11 additions and 4 deletions
+5 -1
View File
@@ -399,7 +399,11 @@ void addmsg(int type, const char *fmt, ...)
numi += n;
break;
}
case 's': sendstring(va_arg(args, const char *), p); nums++; break;
case 's':
{
const char *t = va_arg(args, const char *);
if(t) sendstring(t, p); nums++; break;
}
}
va_end(args);
}
+1 -1
View File
@@ -1634,7 +1634,7 @@ void setadmin(char *claim, char *password)
if((y != 1) && (player1->clientrole))
{
conoutf(_("you released admin status"));
addmsg(SV_SETADMIN, "ris", 0);
addmsg(SV_SETADMIN, "ri", 0);
}
else
addmsg(SV_SETADMIN, "ris", y, genpwdhash(player1->name, password, sessionid));
+5 -2
View File
@@ -3353,8 +3353,11 @@ void process(ENetPacket *packet, int sender, int chan)
case SV_SETADMIN:
{
bool claim = getint(p) != 0;
getstring(text, p);
changeclientrole(sender, claim ? CR_ADMIN : CR_DEFAULT, text);
if(claim)
{
getstring(text, p);
changeclientrole(sender, CR_ADMIN, text);
} else changeclientrole(sender, CR_DEFAULT);
break;
}