Raised This Month: $ Target: $400
 0% 

Functions what work fine in windows but crash in linux (research thread)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 06-22-2014 , 14:34   Re: Functions what work fine in windows but crash in linux
Reply With Quote #1

PHP Code:
public Ham_Touch_pre(entother)
{
    if(!
is_valid_ent(ent))
        return 
HAM_IGNORED;

    if(
is_user_alive(other))
    {
        new 
owner entity_get_edict(entEV_ENT_owner);
        
//ExecuteHamB(Ham_Killed, other, owner, 0);
        
ExecuteHamB(Ham_TakeDamageotherentowner300.0, (<< 24));
    }


        
emit_sound(entCHAN_AUTO"player/pl_snow1.wav"1.0ATTN_NORM0PITCH_NORM);
        static 
Float:origin[3];
        
entity_get_vector(entEV_VEC_originorigin);
        
sw_effect(origin);
        
remove_entity(ent);


    return 
HAM_SUPERCEDE;

Here is my code which was crashing. Which I discovered was that entity got removed or something like that and server crashed on remove_entity. After putting it in is_valid_ent check it worked fine. Don't know why that happened, but might be ham deleting my entity? Because it was crashing only when I hit player.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-22-2014 , 14:42   Re: Functions what work fine in windows but crash in linux
Reply With Quote #2

Thanks Arkshine and GuskiS.
I found one new crash type yet i dont know how to explain it yet because i dont understand it.
It is something to do with set_view(id, CAMERA_3RDPERSON)
i should recode my player model system because it is doing strange things sometimes.
I tried to be friendly with old version and code got really complicated.

Edit:
If you set player model's submodel what is blank then use set_view(id, CAMERA_3RDPERSON)
server will crash.

If you find/know something then this thread is always welcome to accept your crash cause.

Last edited by .Dare Devil.; 06-22-2014 at 23:37.
.Dare Devil. is offline
Reply



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 21:17.


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