Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are Clearskies binary features possible? #4

Open
Juli199696 opened this issue Jul 25, 2018 · 2 comments
Open

Are Clearskies binary features possible? #4

Juli199696 opened this issue Jul 25, 2018 · 2 comments

Comments

@Juli199696
Copy link

Juli199696 commented Jul 25, 2018

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

}

@Juli199696 Juli199696 changed the title Clearskies Binary features possible? Are Clearskies binary features possible? Jul 25, 2018
@phantasyy
Copy link

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

@pedrxd
Copy link
Owner

pedrxd commented Dec 16, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants