Jump to content

Home

server-side bg_pmove.c cvars...


ensiform

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

Archived

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

×
×
  • Create New...