static analyzer - shk.c

Add a couple of redundant tests for 'shkp = shop_keeper()' yielding
Null to pacify the static analyzer.

Make the paired calls to shkp = shop_keeper() and inhishop(shkp) look
more consistent.  Barring typos, the behavior hasn't been changed.
This commit is contained in:
PatR
2023-01-16 17:15:26 -08:00
parent 9b01ab2fd5
commit 9df4a38d65
2 changed files with 59 additions and 41 deletions

View File

@@ -1145,7 +1145,7 @@ dochat(void)
Your("speech is unintelligible underwater.");
return ECMD_OK;
}
if (!Deaf && !Blind && (otmp = shop_object(u.ux, u.uy)) != (struct obj *) 0) {
if (!Deaf && !Blind && (otmp = shop_object(u.ux, u.uy)) != 0) {
/* standing on something in a shop and chatting causes the shopkeeper
to describe the price(s). This can inhibit other chatting inside
a shop, but that shouldn't matter much. shop_object() returns an