Quote Originally Posted by voron00 View Post
PHP Code:
int hook_BG_IsWeaponValid(int a1int a2) {
    
    
int v3;
    
char v4;
    
    
signed int (*sub_80E9758)(int a1);
    *(
int *)&sub_80E9758 0x80E9758;
    
    
int (*sub_80D9E84)(int a1signed int a2);
    *(
int *)&sub_80D9E84 0x80D9E84;
    
    
int (*sub_80E9270)(int a1);
    *(
int *)&sub_80E9270 0x80E9270;

    
v4 1;
    if ( !(
unsigned int8_t)sub_80E9758(a2) )
        
v4 0;
    if ( !(
unsigned int8_t)sub_80D9E84(a1 1348a2) )
        
v4 0;
    
v3 sub_80E9270(a2);
    if ( !*(
long *)(v3 132) && *(char *)(a1 1365) != a2 && *(char *)(a1 1366) != a2 && *(long *)(v3 876) != a2 )
        
v4 0;
    
    
// printf("Testcall\n");

    
return (unsigned int8_t)v4;

Sooo for the short functions we can only change types of variables and it will work out anyway? Whoa.

But where did it came from?

PHP Code:
signed int (*sub_80E9758)(int a1);
    *(
int *)&sub_80E9758 0x80E9758;
    
    
int (*sub_80D9E84)(int a1signed int a2);
    *(
int *)&sub_80D9E84 0x80D9E84;
    
    
int (*sub_80E9270)(int a1);
    *(
int *)&sub_80E9270 0x80E9270
My _weapons.gsc file is nothing special. I've only added function deleting machine guns and added precaching every rifle for every team. http://pastebin.com/yKg1RfBb

I've added some prints to your hook function. It compiled properly (Thanks!). Just waiting for the server to become empty so I can implement new libcod.