PDA

View Full Version : GSC IsMantling



php
5th April 2015, 17:16
Requested by IzNoGoD




void PlayerCmd_IsMantling(int self) {

/*

mantling m8 a1=fff9d750, a2=fff9d500, *(int*)a1 = 8705480
mantling m8 a1=fff9d750, a2=fff9d500, *(int*)a1 = 8705480 = unk_8705480

*/
#if COD_VERSION == COD2_1_2
int idk = 0x8705480 + 10404 * self + 0xc;
#elif COD_VERSION == COD2_1_3
int idk = 0x87A2500 + 10404 * self + 0xc;
#elif COD_VERSION == COD2_1_0
int idk = 0x86F1480 + 10404 * self + 0xc;
#endif

if(*(int*)idk & 4) //oi m8 im mantling give me a break
stackPushInt(1);
else
stackPushInt(0);
}

IzNoGoD
5th April 2015, 20:36
Confirmed working on 1.3. Nice :D

Mitch
5th April 2015, 23:42
#if COD_VERSION == COD2_1_2
int idk = 0x8705480 + 10404 * self + 0xc;
#elif COD_VERSION == COD2_1_3
int idk = 0x87A2500 + 10404 * self + 0xc;
#elif COD_VERSION == COD2_1_0
int idk = 0x86F1480 + 10404 * self + 0xc;
#endif


is equal to


int idk = PLAYERSTATE(id) + 0xc;

It might also be possible to make IsOnLadder() and IsTalking() with the 'idk' variable.

IzNoGoD
6th April 2015, 02:18
istalking woudl be very nice to have :D

Mitch
6th April 2015, 09:45
istalking woudl be very nice to have :D

It appears that istalking already exists in cod2.

Edit: isonladder works: https://github.com/M-itch/libcod/commit/8a6b613170727cdc7f6bda0cfb87015a7a75946d