From eff7705812a0dfb2d1773d8024231e31f81d6fe1 Mon Sep 17 00:00:00 2001 From: BjossiAlfreds Date: Sat, 24 Sep 2022 14:03:07 +0000 Subject: [PATCH] Fix coop power cube related bugs --- src/g_items.c | 2 +- src/player/hud.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/g_items.c b/src/g_items.c index ca3999f..0b40874 100644 --- a/src/g_items.c +++ b/src/g_items.c @@ -2090,7 +2090,7 @@ SpawnItem(edict_t *ent, gitem_t *item) PrecacheItem(item); - if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0)) + if (coop->value && !(ent->spawnflags & ITEM_NO_TOUCH) && (strcmp(ent->classname, "key_power_cube") == 0)) { ent->spawnflags |= (1 << (8 + level.power_cubes)); level.power_cubes++; diff --git a/src/player/hud.c b/src/player/hud.c index 02a33ca..5ea09ad 100644 --- a/src/player/hud.c +++ b/src/player/hud.c @@ -113,13 +113,15 @@ BeginIntermission(edict_t *targ) } /* strip players of all keys between units */ - for (n = 0; n < MAX_ITEMS; n++) + for (n = 0; n < game.num_items; n++) { if (itemlist[n].flags & IT_KEY) { client->client->pers.inventory[n] = 0; } } + + client->client->pers.power_cubes = 0; } } }