aboutsummaryrefslogtreecommitdiff
path: root/effects.h
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-05-09 12:15:44 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-05-09 12:15:44 +0000
commit3eee64398bdfde684199873793febadbd6fa4a19 (patch)
treeec32b6c263dd03edc0c7767f690087e2109a8631 /effects.h
parent3a51283329635021b839c8abbea4fac6bd7fe688 (diff)
downloadbullet-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.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/effects.h b/effects.h
index 0e40824..d71a445 100644
--- a/effects.h
+++ b/effects.h
@@ -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;