AddUntargetableToSpawn (#4872)

Adds the db entry for untargetable to the spawn struct
This commit is contained in:
Mitch Freeman 2025-04-28 18:50:57 -03:00 committed by GitHub
parent cd003ff0b7
commit c08f286817
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -324,6 +324,7 @@ union
bool guild_show;
bool trader;
bool buyer;
bool untargetable;
};
struct PlayerState_Struct {

View File

@ -4688,7 +4688,7 @@ namespace RoF2
Bitfields->linkdead = 0;
Bitfields->showhelm = emu->showhelm;
Bitfields->trader = emu->trader ? 1 : 0;
Bitfields->targetable = 1;
Bitfields->targetable = emu->NPC ? emu->untargetable : 1;
Bitfields->targetable_with_hotkey = emu->targetable_with_hotkey ? 1 : 0;
Bitfields->showname = ShowName;

View File

@ -1312,7 +1312,8 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.NPC = IsClient() ? 0 : 1;
ns->spawn.IsMercenary = IsMerc() ? 1 : 0;
ns->spawn.targetable_with_hotkey = no_target_hotkey ? 0 : 1; // opposite logic!
ns->spawn.untargetable = IsTargetable();
ns->spawn.petOwnerId = ownerid;
ns->spawn.haircolor = haircolor;