Accidental copying of triangles in collision checking loop.

removeExposedPackKey
sigonasr2 5 months ago
parent 1f635a667d
commit abb18767d4
  1. 8
      Adventures in Lestoria/StoneGolem.cpp
  2. 1
      Adventures in Lestoria/TODO.txt

@ -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<geom2d::triangle<float>>collisionTris{any_cast<StageMaskPolygon>(data).GetCollisionTriangles()};
for(geom2d::triangle<float>tri:collisionTris){
for(const geom2d::triangle<float>&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"));
}

@ -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
====

Loading…
Cancel
Save