To make the disruptor cancel out if the player is moving, or moving above a specified velocity:
about line 7201 in bg_pmove.c (
http://www.mt-wudan.com/jkamp/bg__pmove_8c-source.html)
Change this section in PM_Weapon():
if (pm->ps->weapon == WP_DISRUPTOR &&
pm->ps->zoomMode == 1)
{
if (pm_cancelOutZoom)
{
pm->ps->zoomMode = 0;
pm->ps->zoomFov = 0;
pm->ps->zoomLocked = qfalse;
pm->ps->zoomLockTime = 0;
PM_AddEvent( EV_DISRUPTOR_ZOOMSOUND );
return;
}
if (pm->cmd.forwardmove ||
pm->cmd.rightmove ||
pm->cmd.upmove > 0)
{
return;
}
}
To this:
if (pm->ps->weapon == WP_DISRUPTOR &&
pm->ps->zoomMode == 1)
{
if (pm->cmd.forwardmove ||
pm->cmd.rightmove ||
pm->cmd.upmove > 0)
{
pm_cancelOutZoom = qtrue;
}
if (pm_cancelOutZoom)
{
pm->ps->zoomMode = 0;
pm->ps->zoomFov = 0;
pm->ps->zoomLocked = qfalse;
pm->ps->zoomLockTime = 0;
PM_AddEvent( EV_DISRUPTOR_ZOOMSOUND );
}
return;
}
What this'll do is cancel the zoomMode if the player is moving at all. What you might want to try is this:
//here's a float for the player's velocity:
float playerspeed = 0;
if (pm->ps->weapon == WP_DISRUPTOR &&
pm->ps->zoomMode == 1)
{
playerspeed = VectorLength( pm->ps->velocity );
// the 5.0 is just ... a number -
//play with it to get the desired effect.
if ( playerspeed > 5.0 )
{
pm_cancelOutZoom = qtrue;
}
if (pm_cancelOutZoom)
{
pm->ps->zoomMode = 0;
pm->ps->zoomFov = 0;
pm->ps->zoomLocked = qfalse;
pm->ps->zoomLockTime = 0;
PM_AddEvent( EV_DISRUPTOR_ZOOMSOUND );
}
return;
}