From 1c5b72410aa9333e4830df726d1ca59d72ae9df3 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 5 Sep 2020 17:23:09 -0700 Subject: [PATCH] De-duplicate spike hitbox checks for player/SCM The spike hitbox check is now one function for both the player and the supercrewmate, instead of being two separate functions. --- desktop_version/src/Entity.cpp | 33 ++++----------------------------- desktop_version/src/Entity.h | 4 +--- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 27bb6d5f..ff45c43b 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -3859,37 +3859,12 @@ bool entityclass::entitycollide( int a, int b ) return false; } -bool entityclass::checkdamage() +bool entityclass::checkdamage(bool scm /*= false*/) { - //Returns true if player entity (rule 0) collides with a damagepoint + //Returns true if player (or supercrewmate) collides with a damagepoint for(size_t i=0; i < entities.size(); i++) { - if(entities[i].rule==0) - { - tempx = entities[i].xp + entities[i].cx; - tempy = entities[i].yp + entities[i].cy; - tempw = entities[i].w; - temph = entities[i].h; - rectset(tempx, tempy, tempw, temph); - - for (size_t j=0; j