Skip to content

Commit

Permalink
effects: fix freeze after second vote
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistrick committed Apr 8, 2018
1 parent 1c98ac0 commit 3ce3ea0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions map_manager_effects.sma
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ public mapm_prepare_votelist(type)
// increase freezetime
set_float(FREEZETIME, get_float(FREEZETIME) + get_float(PREPARE_TIME) + get_float(VOTE_TIME) + 1);
} else {
new players[32], pnum; get_players(players, pnum, "a");
for(new id, i; i < pnum; i++) {
id = players[i];
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN);
}
freeze_unfreeze(0);
}
}
EnableHamForward(g_hHamSpawn);
Expand All @@ -144,12 +140,12 @@ public mapm_vote_finished(map[], type, total_votes)
if((type == VOTE_BY_SCHEDULER || type == VOTE_BY_SCHEDULER_SECOND || type == VOTE_BY_RTV) && get_num(VOTE_IN_NEW_ROUND)) {
// decrease freezetime
set_float(FREEZETIME, get_float(FREEZETIME) - get_float(PREPARE_TIME) - get_float(VOTE_TIME) - 1);
} else {
new players[32], pnum; get_players(players, pnum, "a");
for(new id, i; i < pnum; i++) {
id = players[i];
set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN);
// TODO: make this better
if(type == VOTE_BY_SCHEDULER_SECOND) {
freeze_unfreeze(1);
}
} else {
freeze_unfreeze(1);
}
}
DisableHamForward(g_hHamSpawn);
Expand All @@ -158,6 +154,14 @@ public set_full_black(taskid)
{
set_black_screenfade(1);
}
stock freeze_unfreeze(type)
{
new players[32], pnum; get_players(players, pnum, "a");
for(new id, i; i < pnum; i++) {
id = players[i];
set_pev(id, pev_flags, type ? (pev(id, pev_flags) & ~FL_FROZEN) : pev(id, pev_flags) | FL_FROZEN);
}
}
stock set_black_screenfade(fade)
{
new time, hold, flags;
Expand Down

0 comments on commit 3ce3ea0

Please sign in to comment.