mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
Fixed megasphere item selection in bot code
https://forum.zdoom.org/viewtopic.php?t=56604
This commit is contained in:
parent
d633e8afc1
commit
67d313cf25
1 changed files with 5 additions and 3 deletions
|
@ -395,10 +395,12 @@ void DBot::WhatToGet (AActor *item)
|
||||||
else if (item->GetClass()->TypeName == NAME_Megasphere || item->IsKindOf(NAME_Health))
|
else if (item->GetClass()->TypeName == NAME_Megasphere || item->IsKindOf(NAME_Health))
|
||||||
{
|
{
|
||||||
// do the test with the health item that's actually given.
|
// do the test with the health item that's actually given.
|
||||||
if (item->GetClass()->TypeName == NAME_Megasphere) item = GetDefaultByName("MegasphereHealth");
|
AActor* const testItem = NAME_Megasphere == item->GetClass()->TypeName
|
||||||
if (item != nullptr)
|
? GetDefaultByName("MegasphereHealth")
|
||||||
|
: item;
|
||||||
|
if (nullptr != testItem)
|
||||||
{
|
{
|
||||||
int maxhealth = P_GetRealMaxHealth(player->mo, item->IntVar(NAME_MaxAmount));
|
const int maxhealth = P_GetRealMaxHealth(player->mo, testItem->IntVar(NAME_MaxAmount));
|
||||||
if (player->mo->health >= maxhealth)
|
if (player->mo->health >= maxhealth)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue