Fix reinforcement slot index after MAX_UNITS refactor; align E2E freeze-tint sampling

This commit is contained in:
Dejvino
2026-11-15 11:06:33 +01:00
parent 1dcc87d8d4
commit 8008b78db0
4 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -554,8 +554,8 @@ struct Unit {
bool patFlip;
};
static Unit units[nd::MAX_UNITS];
// 0,1 marines | 2 patrol droid | 3 stationary droid | 4 heavy | 5 turret
// 6 = reinforcement slot (spawns on the feedback spike)
// 0,1 marines | 2 patrol droid | 3 stationary droid | 4 heavy | 5,6 turrets
// 7 = reinforcement slot (spawns on the feedback spike)
// transient hitscan tracers / impact flashes
struct Tracer {
@@ -856,13 +856,13 @@ static void stepUnits()
// reinforcement droid queued by the feedback spike
if (reinforcePending) {
reinforcePending = false;
if (!units[6].alive) {
if (!units[7].alive) {
// spawn inside the server room by the blast door, first free tile
static const int SP[5][2] = { {31,12}, {30,12}, {32,12}, {31,11}, {31,13} };
for (int s = 0; s < 5; s++) {
int sx = SP[s][0], sy = SP[s][1];
if (walkable(sx, sy) && !tileOccupied(sx, sy, 6)) {
spawnUnit(6, U_DROID, sx, sy);
if (walkable(sx, sy) && !tileOccupied(sx, sy, 7)) {
spawnUnit(7, U_DROID, sx, sy);
Serial.printf("[spawn] reinforcement droid at %d,%d\n", sx, sy);
break;
}