Merge pull request #906 from BjossiAlfreds/powercubes

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

View file

@ -1638,7 +1638,7 @@ SpawnItem(edict_t *ent, gitem_t *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++;

View file

@ -132,13 +132,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;
}
}
}