Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More perc issues #639

Open
thokkat opened this issue May 24, 2024 · 0 comments
Open

More perc issues #639

thokkat opened this issue May 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@thokkat
Copy link
Contributor

thokkat commented May 24, 2024

Have to bring this up again. In G2 old world Mitten is automatically talking to the player at first meeting if in close distance. But this is happening through a wall when Milten is in the right room and player in the left room in old mage building. Can be tested with -w oldworld.zen and goto pos 0 0 0.

Cause is this line in Npc::canSenseNpc

  if(isNoisy) {
    // no need to be in same room: https://github.com/Try/OpenGothic/issues/420
    ret = ret | SensesBit::SENSE_HEAR;
    }

Commenting out works.


Two open points from #604

Npcs wake up if player is picking a lock in sneak mode.

My suggestion was

- if(ev.groundSounds>0 && isPlayer() && (bodyStateMasked()!=BodyState::BS_SNEAK))
+ if(ev.groundSounds>0 && isPlayer() && (wlkMode&WalkBit::WM_Sneak)!=WalkBit::WM_Sneak)
  world().sendPassivePerc(*this,*this,*this,PERC_ASSESSQUIETSOUND);

I'm asking because this was part of rejected #589 and hasn't been moved to fccda5b.

Secon question was

AssessEnterRoom not sent while sneaking is incorrect. Test case can be house behind Zuris. Guard reacts on enter if sneaking.

This is blocked by the sneak check

void WorldObjects::sendImmediatePerc(Npc& self, Npc& other, Npc& victum, Item* itm, int32_t perc) {
  const auto pl = owner.player();
  if(pl==nullptr || pl->bodyStateMasked()==BS_SNEAK)
    return;

Thesneak check could be removed because ASSESSQUIETSOUND isn't sent in that case. Is this special treatment for QUIETSOUND/ENTERROOM as immediate perc needed at all? Is there a difference in executing immediately or later in the same tick together with other passive percs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant