pedrxd / MinModUrT

The unofficially supported ioquake3 engine by pedrxd for the game Urban Terror 4.2/4.3
GNU General Public License v2.0
9 stars 5 forks source link

Are Clearskies binary features possible? #4

Open Juli199696 opened 6 years ago

Juli199696 commented 6 years ago

Are the features of the clearskies older working binary from 4.3.2 possible to make it work on 4.3.4? Because i am really missing the infiniteAmmo cvar for my server config. I got the binary itself running on 4.3.4 but i cant use any of the more complicated cvars like infiniteammo or icyeverywhere.

Is there any soulution for that? Thank you for reading.

The code for Infinite Ammo should be something like this into the sv_client.c

void SV_ClientThink (client_t cl, usercmd_t cmd) { int i, j; playerState_t * ps;

cl->lastUsercmd = *cmd;

if ( cl->state != CS_ACTIVE ) {
    return;     // may have been kicked during the last usercmd
}

ps = SV_GameClientNum(cl - svs.clients);

#ifdef USE_SERVER_EXTRAS
if (sv_infiniteAmmo->integer) {
    for (i = 0; i < MAX_POWERUPS; i++) {
        cl->powerups[i] = ps->powerups[i];
    }
}
#endif

VM_Call( gvm, GAME_CLIENT_THINK, cl - svs.clients );

#ifdef USE_SERVER_EXTRAS
if (sv_infiniteAmmo->integer) {
    if (cl->lastEventSequence < ps->eventSequence - MAX_PS_EVENTS) {
        cl->lastEventSequence = ps->eventSequence - MAX_PS_EVENTS;
    }

    for (j = cl->lastEventSequence; j < ps->eventSequence; j++) {
        if (ps->events[j & (MAX_PS_EVENTS - 1)] == 31 || ps->weaponstate == WEAPON_FIRING) {
            for (i = 0; i < MAX_POWERUPS; i++) {
                ps->powerups[i] = cl->powerups[i];
            }
        }
    }

    cl->lastEventSequence = ps->eventSequence;
}
#endif

}

phantasyy commented 6 years ago

Yes it's possible but got to find someone that want to do it first :-)

pedrxd commented 5 years ago

The problem is that some struct was changed and the new offset must be found. If someone is interested on found it and do a pull request I would appreciate it.