mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- ensure that AInventory::Touch attributes everything to the correct player, even if the touching action results in a morph.
This commit is contained in:
parent
8993f84087
commit
d2beec4585
1 changed files with 10 additions and 8 deletions
|
@ -979,10 +979,12 @@ static void PrintPickupMessage (const char *str)
|
|||
|
||||
void AInventory::Touch (AActor *toucher)
|
||||
{
|
||||
player_t *player = toucher->player;
|
||||
|
||||
// If a voodoo doll touches something, pretend the real player touched it instead.
|
||||
if (toucher->player != NULL)
|
||||
if (player != NULL)
|
||||
{
|
||||
toucher = toucher->player->mo;
|
||||
toucher = player->mo;
|
||||
}
|
||||
|
||||
bool localview = toucher->CheckLocalView(consoleplayer);
|
||||
|
@ -1010,12 +1012,12 @@ void AInventory::Touch (AActor *toucher)
|
|||
|
||||
// Special check so voodoo dolls picking up items cause the
|
||||
// real player to make noise.
|
||||
if (toucher->player != NULL)
|
||||
if (player != NULL)
|
||||
{
|
||||
PlayPickupSound (toucher->player->mo);
|
||||
PlayPickupSound (player->mo);
|
||||
if (!(ItemFlags & IF_NOSCREENFLASH))
|
||||
{
|
||||
toucher->player->bonuscount = BONUSADD;
|
||||
player->bonuscount = BONUSADD;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1029,16 +1031,16 @@ void AInventory::Touch (AActor *toucher)
|
|||
|
||||
if (flags & MF_COUNTITEM)
|
||||
{
|
||||
if (toucher->player != NULL)
|
||||
if (player != NULL)
|
||||
{
|
||||
toucher->player->itemcount++;
|
||||
player->itemcount++;
|
||||
}
|
||||
level.found_items++;
|
||||
}
|
||||
|
||||
if (flags5 & MF5_COUNTSECRET)
|
||||
{
|
||||
P_GiveSecret(toucher, true, true, -1);
|
||||
P_GiveSecret(player != NULL? (AActor*)player->mo : toucher, true, true, -1);
|
||||
}
|
||||
|
||||
//Added by MC: Check if item taken was the roam destination of any bot
|
||||
|
|
Loading…
Reference in a new issue