0 registered members (),
1,209
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Error 1515 Invalid argument.
#221440
08/14/08 02:25
08/14/08 02:25
|
Joined: Oct 2003
Posts: 130 Wollongong Australia
Jethro
OP
Member
|
OP
Member
Joined: Oct 2003
Posts: 130
Wollongong Australia
|
I reported this a while back, and was too busy to persue at the time. I can confirm this "possible" bug is in all versions from A7.07 up to current beta 7.24.
We intermittently get the following errors E 1515. Invalid argument in Play_one_steam ENTITY. Invalid argument in Flame_Check_Health ENTITY.
Now Flame_check_health. We've put entity Pointer checks in before calling or using the me pointer but it is STILL BROKEN with following code?
Function Play_One_Steam(){ if (me==NULL) {return;} //trying to get rid of invalid argument bug. If (Snd_Playing(POS_Hand)==0){ If (Random(100)<50){ POS_Hand=ent_Playsound(ME,Steam1_Snd,FX_Vol*10); }ELSE{ POS_Hand=ent_Playsound(ME,Steam_bub_Snd,FX_Vol*10); } } }
Function Flame_Check_Health(){
if (me==NULL) {return;} //trying to get rid of invalid argument bug. c_setminmax(me);//we got some damage our scale will be adjusted, If (Vec_dist(Player.x,my.x)<500){ Play_One_Steam(); }
If (MY.Skill40<=0){//Flame death MY.event=null; emit(3,MY.POS,particle_smoke); // emit( smoke //score some points. //Do some smoke or sizzle. wait(2); //Give things above a chance to start before removing me.
if (me==NULL) {return;} //trying to get rid of invalid argument bug. str_for_entfile (temp_str,ME); IF (Str_Cmpi(temp_str,"fire_land.mdl")==1){ //Land fire extinguish, so get bonus and count it off the list. Bonus_Score+=1; Curr_flames-=1;//So weather knows how many fires are raging. only decrement immediately before } ent_Remove(me);Return; } }
//Fire will use this event action. Water scans fire to put it out, however other things may scan fire to flare it up? Function Fire_Ev(){ If ((EVENT_TYPE == EVENT_SCAN)&&(indicator==_Water)){// Put me out //Now result= distance from water sprite, so lets give us more discharge of strength the closer they are to us. My.Skill40-=Water_Strength/(result+1); //So if a dead hit, you get maximum Water_strength/1 discharge. per hit which is 16/second for constant pounding. //one_beep(2);//debug flame scanned by water if (me==NULL) {return;} //trying to get rid of invalid argument bug. Flame_Check_Health(); }ELSE{//no scan damage, check for direct hit. If (YOU!=NULL){ IF (YOU._TYPE==_TYPE_WATERSPRAY){ My.Skill40-=1; //Get reduction of health by 1 for collissions. // one_beep(3);//debug flame collide with water if (me==NULL) {return;} //trying to get rid of invalid argument bug. Flame_Check_Health(); } IF (YOU._TYPE==_TYPE_WATER_Lake){ My.Skill40-=10; //Get reduction of health by 10 for collission with lake ie. kill me very fast. // one_beep(3);//debug flame collide with water if (me==NULL) {return;} //trying to get rid of invalid argument bug. Flame_Check_Health(); }
} }
}
Last edited by Jethro; 08/14/08 02:38.
|
|
|
Re: Error 1515 Invalid argument.
[Re: jcl]
#221531
08/14/08 15:00
08/14/08 15:00
|
Joined: Oct 2003
Posts: 130 Wollongong Australia
Jethro
OP
Member
|
OP
Member
Joined: Oct 2003
Posts: 130
Wollongong Australia
|
OK. I think I fixed it, (it hasn't failed since I implemented the following) but I'm not sure if I'm working around a bug. at the end of the main entity function, (the same function it ran when it was ent_created), Not its event action. I put 2 extra lines in front of the ent_remove, as follows. my.event=null; //try to solve invalid argument bug, ie. turn off events, give them a tick to do them, then remove me
wait(1); // " " "
ent_remove(me); //flame ran out of fuel.
} To ensure the event functions all have a chance to run, before removing the entity. However I shouldn't have to do this as the events either run when me exists, or when me is ent_removed there is no entity to get the event. Jethro.
|
|
|
|