AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Sven Co-op 5.11] m_pActiveItem crashes the game (https://forums.alliedmods.net/showthread.php?t=296243)

Nero-sama 04-15-2017 16:39

[Sven Co-op 5.11] m_pActiveItem crashes the game
 
So since they removed m_pActiveItem and changed it to m_hActiveItem that also changed the offset
const m_pActiveItem = 492
new const item = get_pdata_cbase( i, m_pActiveItem, 4 );

What is the new one/how can I find out?

Thanks :3 <3

klippy 04-15-2017 16:58

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
Could you upload the latest game dll (server)?

The offset may not even be changed. Considering the new "h" prefix, the type has probably been changed to EHANDLE. Try using get_pdata_ehandle() instead. Today, in the AngelScript API change notes, I've seen that they have changed a few members to EHANDLE.

Nero-sama 04-15-2017 17:13

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
Oooooh, didn't even consider that there were other get_pdata O_O
https://www.dropbox.com/s/ywhdh4f9uw...r-dll.rar?dl=0

Thanks :O

Nero-sama 04-15-2017 17:15

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
error 017: undefined symbol "get_pdata_ehandle"
D:

edit: nvm, I need the latest devbuild of amxmodx (I'm running 1.8.2 as well as the servers I'm admining)
fml

klippy 04-15-2017 18:26

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
https://github.com/alliedmodders/amx....inc#L113-L127
Looks like there is get_pdata_ent in 1.8.2. Keep in mind that, as the documentation says, it's byte-addresable, meaning that instead of 492 you would use 1968 (492 * 4 = 1968 ).
EHANDLE has such memory layout (8 bytes):
Code:

edict_t *m_pent;
int m_serialnumber;

As m_pent is first, it should be possible to just use get_pdata_ent() instead on the same offset (times 4). I don't know how safe this is though, as the entity might not be valid or have a different serial number (meaning it's a different entity). I guess just checking for pev_valid() will be alright.

Anyway, I am asking again: can you upload the latest linux server binary? That way I can try to find if the offset has changed.

Nero-sama 04-15-2017 19:42

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
Aight thanks <3
Oh, the linux one :D
yee lemme try to find it

edit: https://www.dropbox.com/s/u1xgk4qn7g...erver.rar?dl=0
There we are :3

klippy 04-15-2017 20:30

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
Looks like it's at 552 (2208 byte-aligned) now.

Nero-sama 04-15-2017 21:02

Re: [Sven Co-op 5.11] m_pActiveItem crashes the game
 
Thank yooou :3 <3


All times are GMT -4. The time now is 18:00.

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