Fix sign/unsigned comparison bug.
We are comparing a signed char with unsigned int. The signed char will be sign exetended when converted to unsigned int causing an unexpected result.
This commit is contained in:
+2
-2
@@ -1191,10 +1191,10 @@ struct monst *mtmp;
|
|||||||
sent out of his room (caller might resort to goodpos() if
|
sent out of his room (caller might resort to goodpos() if
|
||||||
we report failure here, so this isn't full prevention) */
|
we report failure here, so this isn't full prevention) */
|
||||||
if (mtmp->isshk && inhishop(mtmp)) {
|
if (mtmp->isshk && inhishop(mtmp)) {
|
||||||
if (levl[x][y].roomno != ESHK(mtmp)->shoproom)
|
if (levl[x][y].roomno != (unsigned char) ESHK(mtmp)->shoproom)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else if (mtmp->ispriest && inhistemple(mtmp)) {
|
} else if (mtmp->ispriest && inhistemple(mtmp)) {
|
||||||
if (levl[x][y].roomno != EPRI(mtmp)->shroom)
|
if (levl[x][y].roomno != (unsigned char) EPRI(mtmp)->shroom)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* current location is <xx,yy> */
|
/* current location is <xx,yy> */
|
||||||
|
|||||||
Reference in New Issue
Block a user