Closed John-Leitch closed 2 months ago
I have to reject this solution, as it seems intended for NPCs without an assigned place to appear under "Tell Me About" rather than "Where Is", even if they have a Home Place. I'd take a fix to prevents non-placed NPCs from appearing after its building has been loaded once, but that's pretty minor given the complexity
This PR covers the following issue: #2604 (1.0: Person fails to appear in "where is" talk UI for quest)
A few details related to the issue can be found in my comments on the bug. The appears to stem from
Person.GetAssignedPlaceSymbol
returningnull
. Diving a little deeper, apart from the serialization code, the assigned place symbol is only set via thePerson.SetAssignedPlaceSymbol
method. In turn, that method is called in two spots:PlaceNpc
ActionTemplate
, which handlesplace npc
statements.Person.PlaceAtHome
, which is itself called in two spots: a. InPerson.Tick
whenhome.IsPlayerHere
returns true. This explains the NPC begins resolving once the player enters its home. b. TheCreateNpc
ActionTemplate
, which handlescreate npc
statements.Both
T0C00Y00
and10C00Y00
(and maybe others) lackplace npc
orcreate npc
statements for the NPC in question, thus their assigned place is alwaysnull
.While this is apparently a regression, searching through the history, I was not able to easily identify the exact revision that introduced this behavior, so was not entirely sure how this case was meant to be handled. Reviewing the code, I noted that
Person.homePlaceSymbol
was set, despite the NPC not being created. As this value is not public, I added thePerson.GetAssignedOrHomePlaceSymbol
method, whichnull
coalesces the values. I then updated the appropriate calls inTalkManager
, replacingPerson.GetAssignedPlaceSymbol
withPerson.GetAssignedOrHomePlaceSymbol
. This appears to work as expected, with the NPC being resolved by map id.