Beamdog / nwn-issues

Neverwinter Nights: Enhanced Edition Technical Bug Tracker
http://nwn.beamdog.com
31 stars 1 forks source link

SetObjectUiDiscoveryMask updates too late when creating new creatures #667

Open Cjreek opened 2 months ago

Cjreek commented 2 months ago

Describe the bug

When creating a creature like this and setting the UI discovery mask to NONE, the creature name is still visible (for a moment) if a player already had the Tab key pressed when the creature spawns:

object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "blueprint", lLocation, FALSE);
SetObjectUiDiscoveryMask(oCreature, OBJECT_UI_DISCOVERY_NONE);

This even happens in if explicitely first setting the mask to none before even adding the creature to an area (NWNX C++ code):

CNWSCreature* pCreature = new CNWSCreature();
pCreature->LoadFromTemplate("blueprint");
pCreature->m_nUiDiscoveryMask = 0;

Utils::AddToArea(pCreature, pArea, pLocation->m_vPosition.x, pLocation->m_vPosition.y, pLocation->m_vPosition.z);

Custom content or overrides used

No response

Game version

37-9

First seen on game version

No response

OS

Linux

Distribution

Steam