Quote:
Originally Posted by Emp`
Code:
parse(buffer, s_ent, 4, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0);
// ->
parse(buffer, s_ent, 4);
Code:
while( (ent=engfunc(EngFunc_FindEntityByString, ent, "classname", "weaponbox"))>0 )
{
if( ent>0 )
//you already check if the ent is >0 in the while loop
Code:
classname = "";
// ->
copy(classname, 1, "");
//poor way to clear an array
Code:
set_task(0.01,
//this just rounds down to 0.0, but look at next comment
don't see a point in modify_death_speed(weaponbox_ent) because you already set the velocity in weaponbox_spawned(weaponbox_ent, owner) so it really isn't doing anything
Code:
buffer = "";
//same as other comment with clearing array
Approval with changes and confirmation that it works.
|
1. Agree, but didn't know, that it's poss. =P
2. If there are no weaponbox'es that while will be true, but only once (first check), that's why I'm checking it twice.
3. Kk, will change array clear, but just quiruous - what's the diffrence?
4. Set task 0.01 - exucates task in next frame (if 100 fps). Kz_jump_plugin uses the same set_task time to remove duck when teleported. Example: c4 exploaded - predeath - player speed is low speed. Delay - modifyes speed to explotion speed, what can be much bigger.
But ok. I'll make all that, butwont change delay, cuz i'm 100% sure, that it works. I was impressed finding that out two, but belive me - it makes a delay even with 0.0 will make 1 frame delay.
// edit:
Updated to 1.1 :
Changed: (code) modifyed array clear (less cpu usage - I think).
Changed: (code) entity scan (less cpu usage).
Changed: (code) unneded data getting from array - removed (less cpu usage).
__________________