You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Gothic 1 every time I pick up an item from the ground (i.e. a berry at the startpoint) while a Npc looks, he'll shout "Behind you!".
Tracking that down to b_assesstheft(), I can see:
ai_quicklook(self, other);
if (npc_canseenpc(self, other)) {
printdebugnpc(pd_zs_check, "...NSC kann den Dieb sehen!");
if (hlp_isvaliditem(item) && (!hlp_isvalidnpc(victim))) {
printdebugnpc(pd_zs_check, "...Item wurde aufgehoben!"); // Item picked up
...
}
else {
printdebugnpc(pd_zs_check, "...Taschendiebstahl!"); //pickpocket
if (...) {
...
ai_pointatnpc(self, other);
b_say(self, other, "$BEHINDYOU");
So the condition (hlp_isvaliditem(item) && (!hlp_isvalidnpc(victim)) should be true to indicated something picked up, but isn't, leading to the pickpocket branch.
I'm not yet sure what part is wrong though.
The text was updated successfully, but these errors were encountered:
Interestingly Gothic 2 does if (hlp_isvalidnpc(other) && npc_isplayer(other)) and Gothic 1 also does similar things, like if ((hlp_isvalidnpc(other) && (!c_npcisdown(other))) && (!npc_isplayer(other)) , so the player is a valid Npc in both games in other places.
But I guess the player being the "victim" when picking up an item might be strange?
I guess the culprit might be living in Npc::takeItem, which does owner.sendPassivePerc(*this,*this,*this,*it,PERC_ASSESSTHEFT);
marking the player as the victim of the theft. I guess victim might need to be optional?
mmind
changed the title
Behaviour difference hlp_isvaliditem() or hlp_isvalidnpc()
Does theft have a victim
Jan 15, 2025
mmind
changed the title
Does theft have a victim
Does item pickup have a victim (picking up items marked as theft)
Jan 15, 2025
In Gothic 1 every time I pick up an item from the ground (i.e. a berry at the startpoint) while a Npc looks, he'll shout "Behind you!".
Tracking that down to b_assesstheft(), I can see:
So the condition (hlp_isvaliditem(item) && (!hlp_isvalidnpc(victim)) should be true to indicated something picked up, but isn't, leading to the pickpocket branch.
I'm not yet sure what part is wrong though.
The text was updated successfully, but these errors were encountered: