From 6c1a8f456a41e03f94811937f1fc62013b91cb54 Mon Sep 17 00:00:00 2001 From: Stephen Simpson Date: Fri, 21 Oct 2011 19:51:26 -0500 Subject: BUG: not checking if GetSpecificPlayerActor() returns 0 --- src/levelspecial.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/levelspecial.cpp') diff --git a/src/levelspecial.cpp b/src/levelspecial.cpp index e075773..75d7ecc 100644 --- a/src/levelspecial.cpp +++ b/src/levelspecial.cpp @@ -157,6 +157,8 @@ void LevelSpecial_Update(LevelSpecial *self) { OSReport("Changing Physics for Player %d\n", n); Mario = GetSpecificPlayerActor(n); OSReport("Player Actor at %08x\n", Mario); + if(Mario == 0) + continue; // Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 4.0; // Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 4.0; // Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 4.0; @@ -190,6 +192,8 @@ void LevelSpecial_Update(LevelSpecial *self) { for(int n=0; n<4; n++) { Mario = GetSpecificPlayerActor(n); + if(Mario == 0) + continue; Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter * 0.25; Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge * 0.25; Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter * 0.25; @@ -285,6 +289,8 @@ void LevelSpecial_Update(LevelSpecial *self) { // OSReport("Changing Physics for Player %d\n", n); // Mario = GetSpecificPlayerActor(n); // OSReport("Player Actor at %08x\n", Mario); +// if(Mario == 0) +// continue; // Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter / 4.0; // Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge / 4.0; // Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter / 4.0; @@ -318,6 +324,8 @@ void LevelSpecial_Update(LevelSpecial *self) { // // for(int n=0; n<4; n++) { // Mario = GetSpecificPlayerActor(n); +// if(Mario == 0) +// continue; // Mario->aPhysics.info.xDistToCenter = Mario->aPhysics.info.xDistToCenter / 0.25; // Mario->aPhysics.info.xDistToEdge = Mario->aPhysics.info.xDistToEdge / 0.25; // Mario->aPhysics.info.yDistToCenter = Mario->aPhysics.info.yDistToCenter / 0.25; -- cgit v1.2.3