Fixed bug with bullet events deleting other unrelated bullets.

pull/28/head
sigonasr2 1 year ago
parent 1ea4e6f9ca
commit 8c34640e52
  1. 10
      Crawler/Crawler.cpp
  2. 2
      Crawler/Version.h

@ -596,7 +596,7 @@ void Crawler::UpdateEffects(float fElapsedTime){
}
void Crawler::UpdateBullets(float fElapsedTime){
for(auto it=BULLET_LIST.begin();it!=BULLET_LIST.end();++it){
Bullet*b=dynamic_cast<Bullet*>((*it).get());
Bullet*b=(*it).get();
b->Update(fElapsedTime);
b->pos+=b->vel*fElapsedTime;
if(geom2d::overlaps(geom2d::circle(player.GetPos(),12*player.GetSizeMult()/2),geom2d::circle(b->pos,b->radius))){
@ -605,6 +605,7 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(it==BULLET_LIST.end()){
break;
}
continue;
}
}
if(b->pos.x<view.GetWorldTL().x||b->pos.x>view.GetWorldBR().x||b->pos.y<view.GetWorldTL().y||b->pos.y>view.GetWorldBR().y){
@ -612,6 +613,7 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(it==BULLET_LIST.end()){
break;
}
continue;
}
b->lifetime-=fElapsedTime;
if(b->lifetime<=0){
@ -619,6 +621,7 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(it==BULLET_LIST.end()){
break;
}
continue;
}
b->animation.UpdateState(b->internal_animState,fElapsedTime);
}
@ -634,6 +637,7 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(it==PLAYER_BULLET_LIST.end()){
goto outsidePlayerBulletLoop;
}
goto continuePlayerBulletLoop;
}
b->hitList[&m]=true;
}
@ -644,6 +648,7 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(it==PLAYER_BULLET_LIST.end()){
break;
}
continue;
}
b->lifetime-=fElapsedTime;
if(b->lifetime<=0){
@ -651,8 +656,11 @@ void Crawler::UpdateBullets(float fElapsedTime){
if(it==PLAYER_BULLET_LIST.end()){
break;
}
continue;
}
b->animation.UpdateState(b->internal_animState,fElapsedTime);
continuePlayerBulletLoop:
continue;
}
outsidePlayerBulletLoop:
int a;

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 370
#define VERSION_BUILD 373
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save