Jump to content

Home

server-side bg_pmove.c cvars...


ensiform

Recommended Posts

Posted

Here's how i fixed up stubert's b0rked code for wp_disruptor_delay and wp_disruptor_zoomjump:

 

 

have the external declarations in g_local.h like u normally would:

 

extern vmCvar_t WP_DISRUPTOR_DELAY;
extern vmCvar_t WP_DISRUPTOR_ZOOMJUMP;

 

do not decalare them at all in cgame...

 

bg_local.h near the bottom above the include:

 

extern vmCvar_t WP_DISRUPTOR_DELAY;
extern vmCvar_t WP_DISRUPTOR_ZOOMJUMP;

 

now in bg_pmove.c:

 

inside the #ifdef QAGAME:

 

#define PM_DISRUPTOR_DELAY WP_DISRUPTOR_DELAY.integer
#define PM_DISRUPTOR_ZOOMJUMP (WP_DISRUPTOR_ZOOMJUMP.integer & 1)

 

now replace the #endif with:

 

 

#elif CGAME
#define PM_DISRUPTOR_DELAY 0 // no client mod
#define PM_DISRUPTOR_ZOOMJUMP 0 // no client mod
#endif

 

the original code for not allowing jump:

else if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode == 1)
{ //can't jump
	if (pm->cmd.upmove > 0)
	{
		pm->cmd.upmove = 0;
	}
}

 

stu's ****ed up code...

 

else if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode == 1)
{ //can't jump
	//stu- THINK AGAIN!! WP_DISRUPTOR_ZOOMJUMP switches it on and off (it's a cvar)
	if (pm->cmd.upmove > 0)
	{
		if (WP_DISRUPTOR_ZOOMJUMP.integer >= 1) //stu- to allows players to jump while zoomed
		{
		pm->cmd.upmove = 0;
		}
	}
}

 

better code to use:

 

else if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode == 1 && !PM_DISRUPTOR_ZOOMJUMP)
{ //can't jump
	if (pm->cmd.upmove > 0)
	{
		pm->cmd.upmove = 0;
	}
}

 

Now of course you, use your own cvars and do your own sections and this is if the client really is not needed which in this case its not.

Posted

Thanks bro, one thing I was trying to do was allowing the tenloss to be charged up while allowing the player to zoom, kind of like in jo sp. Any idea on how to get that to work?

  • 2 weeks later...
Posted

It's also possible to use additional pm-> OR directly access cvars while in the pm code. If anyone needs a direct example of either, I can provide one.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...