diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 7d5da45a7..2bcc7ca44 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1638,7 +1638,7 @@ void checksectors_d(int snum) } - if (neartagsprite >= 0) + if (neartagsprite != nullptr) { if (fi.checkhitswitch(snum, -1, neartagsprite)) return; diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 7f1487b6e..a98abea6b 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2565,7 +2565,7 @@ void checksectors_r(int snum) if (neartagsprite == nullptr && neartagwall == -1 && neartagsector == -1) { neartag(p->posx, p->posy, p->posz + (16 << 8), p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3); - if (neartagsprite >= 0) + if (neartagsprite != nullptr) { switch (neartagsprite->s.picnum) { @@ -2602,7 +2602,7 @@ void checksectors_r(int snum) if (oldz > 1280) neartagsprite = nullptr; } - if (neartagsprite >= 0) + if (neartagsprite != nullptr) { if (fi.checkhitswitch(snum, -1,neartagsprite)) return; @@ -2638,7 +2638,7 @@ void checksectors_r(int snum) return; case EMPTYBIKE: if (!isRRRA()) return; - OnMotorcycle(p, neartagsprite->GetIndex()); + OnMotorcycle(p, neartagsprite); return; case EMPTYBOAT: if (!isRRRA()) return;