Merge pull request #97 from BjossiAlfreds/powercubes

Fix coop power cube related bugs
This commit is contained in:
Yamagi 2022-10-08 15:37:42 +02:00 committed by GitHub
commit fb2f6bd3b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -2090,7 +2090,7 @@ SpawnItem(edict_t *ent, gitem_t *item)
PrecacheItem(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)); ent->spawnflags |= (1 << (8 + level.power_cubes));
level.power_cubes++; level.power_cubes++;

View file

@ -113,13 +113,15 @@ BeginIntermission(edict_t *targ)
} }
/* strip players of all keys between units */ /* 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) if (itemlist[n].flags & IT_KEY)
{ {
client->client->pers.inventory[n] = 0; client->client->pers.inventory[n] = 0;
} }
} }
client->client->pers.power_cubes = 0;
} }
} }
} }