diff options
author | 2014-05-09 12:15:44 +0000 | |
---|---|---|
committer | 2014-05-09 12:15:44 +0000 | |
commit | 3eee64398bdfde684199873793febadbd6fa4a19 (patch) | |
tree | ec32b6c263dd03edc0c7767f690087e2109a8631 /effects.h | |
parent | 3a51283329635021b839c8abbea4fac6bd7fe688 (diff) | |
download | bullet-lab-remix-3eee64398bdfde684199873793febadbd6fa4a19.tar.xz |
Fix a bug in the credit scene.
Now the pause menu shouldn't be broken now...(It's so hard to reproduce
that I have to assume it *has* been fixed.(IT STILL HAPPENS!!!)
Close the "infinity CLR" "bug".
(Huge) Code cleanup, mainly removing duplicate code.
Allocate bullets dynamically. The array is freed every time a new game
is started.
Add a signal handler, print back trace on error(currently only available
for linux...).
Diffstat (limited to 'effects.h')
-rw-r--r-- | effects.h | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -9,15 +9,7 @@ void SCEffect_Attatch(vector2d Target=vector2d(-100,-100)) if(Target.x<-50&&Target.y<-50)Target=playerpos; for (int ii=1;ii<=cnt;++ii) { - int i; - if (bulcnt==0) - bulcnt=i=1; - else - { - for (i=1;i<=bulcnt;++i) - if (!bullet[i].exist)break; - if (i>bulcnt)bulcnt=i; - } + int i=AllocBullet(); bullet[i].exist=true; bullet[i].bullettype=254; bullet[i].bulletpos.x=Target.x+3; @@ -83,15 +75,7 @@ void BulletEffect_Process(int n) } int BulletEffect_Death(Bullet a,DWORD color) { - int i; - if (bulcnt==0) - bulcnt=i=1; - else - { - for (i=1;i<=bulcnt;++i) - if (!bullet[i].exist)break; - if (i>bulcnt)bulcnt=i; - } + int i=AllocBullet(); bullet[i].exist=true; bullet[i].bullettype=253; bullet[i].bulletpos.x=a.bulletpos.x; |