From abb18767d43c935194a6432759cc9d8ac48228e0 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 21 Jun 2024 03:03:42 -0500 Subject: [PATCH] Accidental copying of triangles in collision checking loop. --- Adventures in Lestoria/StoneGolem.cpp | 8 ++++---- Adventures in Lestoria/TODO.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Adventures in Lestoria/StoneGolem.cpp b/Adventures in Lestoria/StoneGolem.cpp index fca5ecb8..e224609b 100644 --- a/Adventures in Lestoria/StoneGolem.cpp +++ b/Adventures in Lestoria/StoneGolem.cpp @@ -200,18 +200,18 @@ void Monster::STRATEGY::STONE_GOLEM(Monster&m,float fElapsedTime,std::string str if(m.F(A::CASTING_TIMER)<=0.f){ game->SetupWorldShake(ConfigFloat("Shockwave.Shockwave Screen Shake Time")); - bool isSafe{false}; + bool playerIsSafe{false}; for(std::any&data:m.VEC(A::STAGE_POLYGONS)){ std::vector>collisionTris{any_cast(data).GetCollisionTriangles()}; - for(geom2d::triangletri:collisionTris){ + for(const geom2d::triangle&tri:collisionTris){ if(geom2d::overlaps(game->GetPlayer()->Hitbox(),tri)){ - isSafe=true; + playerIsSafe=true; goto DoneWithCollisionCheck; } } } DoneWithCollisionCheck: - if(!isSafe){ + if(!playerIsSafe){ game->GetPlayer()->Hurt(ConfigInt("Shockwave.Damage"),m.OnUpperLevel(),m.GetZ()); game->GetPlayer()->Knockback(util::pointTo(m.GetPos(),game->GetPlayer()->GetPos())*ConfigFloat("Shockwave.Knockback Amount")); } diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 77f5469a..c114d281 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -17,6 +17,7 @@ New Monster Sound Effects Add a Helper Function: Change proximity knockback checks regardless of player/monster friendliness to be a function call instead. +Add rectangular hitbox posssibility to the game for monsters. (specifically for use with pillars) DEMO ====