Remove the input delay setting and players being away
Neither does anything with the server running the games. Counting down to play again moves into the match, so the server and every player agree on it and the results show it starting again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b65cb575f
commit
56af1c357c
8 files changed
+30
-51
No files matched your search
+20
-16
@@ -84,13 +84,26 @@ void Match::update(Sim& sim)
|
||||
{
|
||||
case MATCH_PRACTICE:
|
||||
case MATCH_OVER:
|
||||
// Online, after a queued game, Ready says to play it again (see Session).
|
||||
for (int i = 0; i < sim.fighterCount && state == MATCH_OVER && isOnline; i++)
|
||||
if (sim.fighters[i].is_pressed(CONTROL_READY) && !isGone[i])
|
||||
// Online, after a queued game, Ready says to play it again, and once every player still in it is set, it
|
||||
// counts up to the server starting afresh with them.
|
||||
if (state == MATCH_OVER && isOnline)
|
||||
{
|
||||
int humans = 0;
|
||||
bool isSet = true;
|
||||
for (int i = 0; i < sim.fighterCount; i++)
|
||||
{
|
||||
isReady[i] = !isReady[i];
|
||||
sim.cues->sound_play(isReady[i] ? SOUND_EQUIP : SOUND_UNEQUIP);
|
||||
if (sim.fighters[i].is_pressed(CONTROL_READY) && !isGone[i])
|
||||
{
|
||||
isReady[i] = !isReady[i];
|
||||
sim.cues->sound_play(isReady[i] ? SOUND_EQUIP : SOUND_UNEQUIP);
|
||||
}
|
||||
bool isHuman = owners[i] >= 0 && !isGone[i];
|
||||
humans += isHuman;
|
||||
isSet &= !isHuman || isReady[i];
|
||||
}
|
||||
isSet &= humans >= PLAYERS_MIN || (humans > 0 && rules.isBotFill);
|
||||
againTicks = isSet ? againTicks + 1 : 0;
|
||||
}
|
||||
// In the sandbox, every fighter's edits land, and Ready (R) puts a fighter back at its spawn, still, with
|
||||
// its attacks cleared away. (Keys typed into a text field never reach the controls.)
|
||||
// Online, Ready in a queued game's area readies up for it instead.
|
||||
@@ -628,7 +641,7 @@ bool Match::is_queue_full(Sim& sim, int queuer)
|
||||
bool Match::is_queue_set(Sim& sim, int queuer)
|
||||
{
|
||||
Queue& queue = queues[queuer];
|
||||
if (!queue.isActive || isAway[queuer])
|
||||
if (!queue.isActive)
|
||||
return false;
|
||||
int members[MAX_FIGHTERS];
|
||||
int count = queue_members_get(sim, queuer, members);
|
||||
@@ -654,13 +667,11 @@ void Match::queue_slots_shift(int from, int count)
|
||||
for (int i = from; i + 1 < count; i++)
|
||||
{
|
||||
queues[i] = queues[i + 1];
|
||||
isAway[i] = isAway[i + 1];
|
||||
isGone[i] = isGone[i + 1];
|
||||
}
|
||||
if (count > 0)
|
||||
{
|
||||
queues[count - 1] = {};
|
||||
isAway[count - 1] = false;
|
||||
isGone[count - 1] = false;
|
||||
}
|
||||
std::fill(std::begin(queuedIn), std::end(queuedIn), -1);
|
||||
@@ -675,13 +686,6 @@ void Match::queues_update(Sim& sim)
|
||||
for (int i = 0; i < sim.fighterCount; i++)
|
||||
{
|
||||
Fighter& fighter = sim.fighters[i];
|
||||
if (isAway[i])
|
||||
{
|
||||
fighter.controls = {};
|
||||
queuedIn[i] = -1;
|
||||
isQueueReady[i] = false;
|
||||
continue;
|
||||
}
|
||||
int in = -1;
|
||||
if (queues[i].isActive)
|
||||
in = i;
|
||||
@@ -690,7 +694,7 @@ void Match::queues_update(Sim& sim)
|
||||
{
|
||||
Rect area = queues[j].area;
|
||||
area = {area.x - QUEUE_FEET_SLACK, area.y, area.w + QUEUE_FEET_SLACK * 2, area.h + QUEUE_FEET_SLACK};
|
||||
if (queues[j].isActive && !isAway[j] && fighter.isAlive && is_point_in_rect(feet, area))
|
||||
if (queues[j].isActive && fighter.isAlive && is_point_in_rect(feet, area))
|
||||
in = j;
|
||||
}
|
||||
if (in != queuedIn[i])
|
||||
|
||||
Reference in new issue
Block a user