hud fixes, vote restrictions

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1589 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-02-03 09:11:51 +00:00
parent e6ccccdd65
commit 05271aece7
5 changed files with 7 additions and 8 deletions
Binary file not shown.
+1 -1
View File
@@ -642,7 +642,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
player1->spectating = SM_FLY;
}
//else stopdemo();
else callvote(SA_STOPDEMO); // FIXME
//else callvote(SA_STOPDEMO); // FIXME
demoplayback = on!=0;
break;
}
+1 -1
View File
@@ -448,7 +448,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
glOrtho(0, VIRTW*3/2, VIRTH*3/2, 0, -1, 1);
const int left = (VIRTW*3/2)*6/8, top = (VIRTH*3/2)*3/4;
draw_textf("F7 spectate", left, top);
draw_textf("F8 followplayer", left, top+80);
draw_textf("F8 follow player", left, top+80);
}
if(player1->state==CS_SPECTATE || (player1->state==CS_DEAD && player1->spectating!=SM_NONE))
+2 -3
View File
@@ -566,7 +566,7 @@ void enddemorecord()
demorecord = NULL;
#ifdef WIN32
demotmp = fopen("demorecord", "rb");
demotmp = fopen(path("demos/demorecord", true), "rb");
#endif
if(!demotmp) return;
@@ -1433,7 +1433,7 @@ void checkvotes(bool forceend)
loopv(clients) if(clients[i]->type!=ST_EMPTY && clients[i]->connectmillis < curvote->callmillis) { stats[clients[i]->vote]++; };
int total = stats[VOTE_NO]+stats[VOTE_YES]+stats[VOTE_NEUTRAL];
const float requiredcount = 0.51f;
if(stats[VOTE_YES]/(float)total > requiredcount || (curvote->isvalid() && clients[curvote->owner]->role > curvote->action->role))
if(stats[VOTE_YES]/(float)total > requiredcount || (curvote->isvalid() && clients[curvote->owner]->role >= curvote->action->role))
{
sendf(-1, 1, "ri2", SV_VOTERESULT, VOTE_YES);
curvote->pass();
@@ -2427,4 +2427,3 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
#endif
+3 -3
View File
@@ -122,7 +122,7 @@ struct recorddemoaction : enableaction
void perform() { demonextmatch = enable; }
recorddemoaction(bool enable) : enableaction(enable)
{
role = CR_MASTER;
role = CR_ADMIN;
dedicated = true;
}
};
@@ -136,7 +136,7 @@ struct stopdemoaction : serveraction
}
stopdemoaction()
{
role = CR_MASTER;
role = CR_ADMIN;
dedicated = true;
}
};
@@ -147,7 +147,7 @@ struct cleardemosaction : serveraction
void perform() { cleardemos(demo); }
cleardemosaction(int demo) : demo(demo)
{
role = CR_MASTER;
role = CR_ADMIN;
dedicated = true;
}
};