Raised This Month: $ Target: $400
 0% 

Very strange error [ENGINE] Invalid entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hattfield
Junior Member
Join Date: Oct 2013
Old 11-07-2013 , 02:56   Very strange error [ENGINE] Invalid entity
Reply With Quote #1

L 11/07/2013 - 17:42:26: [ENGINE] Invalid entity 80
L 11/07/2013 - 17:42:26: [AMXX] Displaying debug trace (plugin "npc.amxx")
L 11/07/2013 - 17:42:26: [AMXX] Run time error 10: native error (native "entity_set_float")
L 11/07/2013 - 17:42:26: [AMXX] [0] npc.sma::set_entity_anim (line 507)
L 11/07/2013 - 17:42:26: [AMXX] [1] npc.sma::stop_run (line 326)

Plugin works fine, but if npc doing skill (before it, i wrote "sv_restart 1") and skill animation in progress - the game is restarted and this error occurs. What's that?

From source:

Code:
public stop_run(ent)
{
    push_and_crush = 0
    set_entity_anim(ent, 8)   -------------------line 326
    entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
    entity_set_float(ent, EV_FL_takedamage, 1.0)
    entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
}
Anim stock code

Code:
stock set_entity_anim(ent, anim)
{
    entity_set_float(ent, EV_FL_animtime, get_gametime())
    entity_set_float(ent, EV_FL_framerate, 1.0)
    entity_set_float(ent, EV_FL_frame, 0.0)
    entity_set_int(ent, EV_INT_sequence, anim)    
}

Last edited by hattfield; 11-07-2013 at 03:07.
hattfield is offline
hattfield
Junior Member
Join Date: Oct 2013
Old 11-07-2013 , 03:44   Re: Very strange error [ENGINE] Invalid entity
Reply With Quote #2

Fixed by adding checking for every animation...

Code:
public stop_run(ent)
{
    if(is_valid_ent(ent))
    {    
        push_and_crush = 0
        set_entity_anim(ent, 8)
        entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
        entity_set_float(ent, EV_FL_takedamage, 1.0)
        entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
    }
}
This is not good, maybe somebody knows, how to fix it without checking?
hattfield is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-07-2013 , 16:32   Re: Very strange error [ENGINE] Invalid entity
Reply With Quote #3

Is stop_run called in a task or in the NPC think?

Last edited by baneado; 11-07-2013 at 16:33.
baneado is offline
hattfield
Junior Member
Join Date: Oct 2013
Old 11-08-2013 , 14:49   Re: Very strange error [ENGINE] Invalid entity
Reply With Quote #4

in a task
hattfield is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-08-2013 , 16:36   Re: Very strange error [ENGINE] Invalid entity
Reply With Quote #5

Quote:
Originally Posted by hattfield View Post
in a task
so, make a task like:
PHP Code:
#define TASK_STOP 3876
set_task(yourfloat"stop_run"entity+TASK_STOP)

// when ent disappeared/removed by you
remove_task(entity+TASK_STOP
I think do you remove the ent at round end? This would be fix it.

Last edited by baneado; 11-08-2013 at 16:39.
baneado is offline
hattfield
Junior Member
Join Date: Oct 2013
Old 11-08-2013 , 16:44   Re: Very strange error [ENGINE] Invalid entity
Reply With Quote #6

Thanks! It's very useful.
hattfield is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode