05 May 2010

This commit is contained in:
g-cont 2010-05-05 00:00:00 +04:00 committed by Alibek Omarov
parent 2760655777
commit f49e1f403b
33 changed files with 164 additions and 132 deletions

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
# ADD CPP /nologo /G5 /MT /W3 /O2 /I "..\bshift" /I "..\common" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /GB /MD /W3 /GX /O2 /I "..\bshift" /I "..\common" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@ -82,12 +82,12 @@ SOURCE="$(InputPath)"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MT /W3 /O1 /I "..\dlls" /I "..\engine" /I "..\common" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "QUIVER" /D "VOXEL" /D "QUAKE2" /D "VALVE_DLL" /YX /FD /c
# SUBTRACT BASE CPP /Fr
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\bshift" /I "..\common" /I "..\game_shared" /D "DEBUG" /D "WIN32" /D "_WINDOWS" /FR /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\bshift" /I "..\common" /I "..\game_shared" /D "DEBUG" /D "WIN32" /D "_WINDOWS" /FR /FD /c
# SUBTRACT CPP /WX /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\Release/server.bsc"
# ADD BSC32 /nologo /o"..\temp\bshift\!debug/server.bsc"

View File

@ -341,7 +341,7 @@ void HUD_UpdateEntityVars( edict_t *ent, const entity_state_t *state, const enti
ent->v.controller[i] = state->controller[i];
// g-cont. moved here because we may needs apply null scale to skyportal
if( ent->v.scale == 0.0f ) ent->v.scale = 1.0f;
if( ent->v.scale == 0.0f && ent->v.skin >= 0 ) ent->v.scale = 1.0f;
ent->v.pContainingEntity = ent;
}

View File

@ -146,7 +146,7 @@ void ProcessRain( void )
vecEnd[2] = -4096;
TraceResult tr;
TRACE_HULL( vecStart, vecStart + vecEnd, true, 1, player, &tr );
UTIL_TraceLine( vecStart, vecStart + vecEnd, ignore_monsters, player, &tr );
if ( tr.fStartSolid || tr.fAllSolid )
{

View File

@ -846,7 +846,7 @@ float V_CalcWaterLevel( ref_params_t *pparams )
float waterDist = cl_waterdist->value;
Vector point;
edict_t *pwater = g_engfuncs.pfnWaterEntity( pparams->simorg );
edict_t *pwater = g_engfuncs.pfnWaterEntity( pparams->simorg );
if( pwater ) waterDist += ( pwater->v.scale * 16 );
point = pparams->vieworg;

View File

@ -19,6 +19,9 @@
#include "utils.h"
#include "hud.h"
#include "aurora.h"
#include "ref_params.h"
extern ref_params_t *gpViewParams;
// CHud message handlers
DECLARE_HUDMESSAGE( HUDColor );
@ -285,6 +288,11 @@ int CHud :: MsgFunc_CamData( const char *pszName, int iSize, void *pbuf )
m_iCameraMode = 1;
else m_iCameraMode = m_iLastCameraMode;
// update pparams->viewentity too for right hearing
if( gHUD.viewEntityIndex )
gpViewParams->viewentity = gHUD.viewEntityIndex;
else gpViewParams->viewentity = GetLocalPlayer()->serialnumber;
END_READ();
return 1;

View File

@ -5,6 +5,8 @@
#ifndef TRACE_DEF_H
#define TRACE_DEF_H
#define FTRACE_SIMPLEBOX (1<<0) // traceline with a simple box
typedef enum { point_hull = 0, human_hull = 1, large_hull = 2, head_hull = 3 };
typedef enum { ignore_monsters = 1, dont_ignore_monsters = 0, missile = 2 } IGNORE_MONSTERS;
typedef enum { ignore_glass = 1, dont_ignore_glass = 0 } IGNORE_GLASS;

View File

@ -489,8 +489,8 @@ void CL_DrawCrosshair( void )
if( pPlayer->v.health <= 0.0f || pPlayer->v.flags & FL_FROZEN )
return;
// camera on
if( pPlayer->serialnumber != cl.refdef.viewentity )
// any camera on
if( cl.refdef.viewentity != pPlayer->serialnumber )
return;
// get crosshair dimension
@ -1669,22 +1669,26 @@ pfnWaterEntity
*/
static edict_t *pfnWaterEntity( const float *rgflPos )
{
edict_t *player, *pWater;
edict_t *pWater, *touch[MAX_EDICTS];
int i, num;
if( !rgflPos ) return NULL;
player = CL_GetLocalPlayer ();
if( !player ) return NULL;
pWater = CL_Move( rgflPos, vec3_origin, vec3_origin, rgflPos, MOVE_NOMONSTERS, player ).pHit;
// grab contents from all the water entities
num = CL_AreaEdicts( rgflPos, rgflPos, touch, MAX_EDICTS, AREA_CUSTOM );
if( CL_IsValidEdict( pWater ))
for( i = 0; i < num; i++ )
{
int mod_type = CM_GetModelType( pWater->v.modelindex );
int cont = pWater->v.skin;
pWater = touch[i];
// make sure what is a really water entity
if(( mod_type == mod_brush || mod_type == mod_world ) && (cont <= CONTENTS_WATER && cont >= CONTENTS_LAVA ))
return pWater;
if( !CL_IsValidEdict( pWater ))
continue;
if( pWater->v.solid != SOLID_NOT || pWater->v.skin == CONTENTS_NONE )
continue; // invalid water ?
// return first valid water entity
return pWater;
}
return NULL;
}

View File

@ -258,7 +258,7 @@ static TraceResult PM_TraceModel( edict_t *pEnt, const vec3_t start, const vec3_
clgame.pmove->usehull = bound( 0, clgame.pmove->usehull, 3 );
mins = clgame.pmove->player_mins[clgame.pmove->usehull];
maxs = clgame.pmove->player_maxs[clgame.pmove->usehull];
result = CL_ClipMoveToEntity( pEnt, start, mins, maxs, end, umask, FTRACE_SIMPLEBOX );
result = CL_ClipMoveToEntity( pEnt, start, mins, maxs, end, umask, FMOVE_SIMPLEBOX );
Mem_Copy( &out, &result, sizeof( TraceResult ));
return out;

View File

@ -311,7 +311,7 @@ trace_t CL_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3
if( ent == clgame.edicts )
CM_BoxTrace( &trace, start, end, mins, maxs, handle, umask, TR_AABB );
else if( !(flags & FTRACE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
else if( !(flags & FMOVE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
{
if( CM_HitboxTrace( &trace, ent, start, end )); // continue tracing bbox if hitbox missing
else CM_TransformedBoxTrace( &trace, start, end, mins, maxs, handle, umask, origin, angles, TR_AABB );
@ -322,7 +322,7 @@ trace_t CL_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3
if( trace.flFraction < 1.0f || trace.fStartSolid )
trace.pHit = ent;
if( !(flags & FTRACE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
if( !(flags & FMOVE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
{
if( VectorIsNull( mins ) && VectorIsNull( maxs ) && trace.iHitgroup == -1 )
{
@ -413,7 +413,7 @@ static void CL_ClipToLinks( areanode_t *node, moveclip_t *clip )
if( clip->passedict && !VectorIsNull( clip->passedict->v.size ) && VectorIsNull( touch->v.size ))
continue; // points never interact
if( clip->flags & FTRACE_IGNORE_GLASS && CM_GetModelType( touch->v.modelindex ) == mod_brush )
if( clip->flags & FMOVE_IGNORE_GLASS && CM_GetModelType( touch->v.modelindex ) == mod_brush )
{
vec3_t point;

View File

@ -10,8 +10,8 @@
#define MOVE_MISSILE 2 // extra size for monsters
#define MOVE_WORLDONLY 3 // clip only world
#define FTRACE_IGNORE_GLASS 0x100
#define FTRACE_SIMPLEBOX 0x200
#define FMOVE_IGNORE_GLASS 0x100
#define FMOVE_SIMPLEBOX 0x200
/*
===============================================================================

View File

@ -879,7 +879,7 @@ void Host_Init( const int argc, const char **argv )
host_nosound = Cvar_Get( "host_nosound", "0", CVAR_SYSTEMINFO, "disable sound system" );
timescale = Cvar_Get( "timescale", "1.0", 0, "slow-mo timescale" );
s = va( "^1Xash %g ^3%s", GI->version, buildstring );
s = va( "^1Xash %g ^3%s", SI->version, buildstring );
Cvar_Get( "version", s, CVAR_INIT, "engine current version" );
// content control

View File

@ -1576,7 +1576,7 @@ static void pfnTraceLine( const float *v1, const float *v2, int fNoMonsters, edi
trace_t result;
if( svgame.globals->trace_flags & 1 )
fNoMonsters |= FTRACE_SIMPLEBOX;
fNoMonsters |= FMOVE_SIMPLEBOX;
svgame.globals->trace_flags = 0;
if( VectorIsNAN( v1 ) || VectorIsNAN( v2 ))
@ -1621,7 +1621,7 @@ static void pfnTraceHull( const float *v1, const float *v2, int fNoMonsters, int
maxs = GI->client_maxs[hullNumber];
if( svgame.globals->trace_flags & 1 )
fNoMonsters |= FTRACE_SIMPLEBOX;
fNoMonsters |= FMOVE_SIMPLEBOX;
svgame.globals->trace_flags = 0;
if( VectorIsNAN( v1 ) || VectorIsNAN( v2 ))
@ -1648,7 +1648,7 @@ static int pfnTraceMonsterHull( edict_t *pEdict, const float *v1, const float *v
}
if( svgame.globals->trace_flags & 1 )
fNoMonsters |= FTRACE_SIMPLEBOX;
fNoMonsters |= FMOVE_SIMPLEBOX;
svgame.globals->trace_flags = 0;
mins = pEdict->v.mins;

View File

@ -56,7 +56,7 @@ realcheck:
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_WORLDONLY, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
if( trace.flFraction == 1.0f )
return false;
@ -72,7 +72,7 @@ realcheck:
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_WORLDONLY, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
else trace = SV_Move( start, vec3_origin, vec3_origin, stop, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
if( trace.flFraction != 1.0f && trace.vecEndPos[2] > bottom )
bottom = trace.vecEndPos[2];
@ -134,7 +134,7 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
{
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( oldorg, ent->v.mins, ent->v.maxs, neworg, MOVE_WORLDONLY, ent );
else trace = SV_Move( oldorg, ent->v.mins, ent->v.maxs, neworg, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
else trace = SV_Move( oldorg, ent->v.mins, ent->v.maxs, neworg, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
if( trace.flFraction == 1.0f )
{
@ -158,7 +158,7 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_WORLDONLY, ent );
else trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
else trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
if( trace.fAllSolid )
return false;
@ -169,7 +169,7 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_WORLDONLY, ent );
else trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
else trace = SV_Move( neworg, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
if( trace.fAllSolid || trace.fStartSolid )
return false;
@ -198,7 +198,7 @@ bool SV_WalkMove( edict_t *ent, const vec3_t move, int iMode )
// check our pos
if( iMode == WALKMOVE_WORLDONLY )
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_WORLDONLY, ent );
else trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL|FTRACE_SIMPLEBOX, ent );
else trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL|FMOVE_SIMPLEBOX, ent );
if( trace.fStartSolid )
{
@ -404,7 +404,7 @@ static TraceResult PM_TraceModel( edict_t *pEnt, const vec3_t start, const vec3_
svgame.pmove->usehull = bound( 0, svgame.pmove->usehull, 3 );
mins = svgame.pmove->player_mins[svgame.pmove->usehull];
maxs = svgame.pmove->player_maxs[svgame.pmove->usehull];
result = SV_ClipMoveToEntity( pEnt, start, mins, maxs, end, umask, FTRACE_SIMPLEBOX );
result = SV_ClipMoveToEntity( pEnt, start, mins, maxs, end, umask, FMOVE_SIMPLEBOX );
Mem_Copy( &out, &result, sizeof( TraceResult ));
return out;

View File

@ -699,7 +699,7 @@ trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int
type = MOVE_NOMONSTERS; // only clip against bmodels
else type = MOVE_NORMAL;
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, end, type|FTRACE_SIMPLEBOX, ent );
trace = SV_Move( ent->v.origin, ent->v.mins, ent->v.maxs, end, type|FMOVE_SIMPLEBOX, ent );
VectorCopy( trace.vecEndPos, ent->v.origin );
SV_LinkEdict( ent, true );
@ -719,10 +719,7 @@ trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apush, int
if( blocked ) *blocked = !VectorCompare( ent->v.origin, end ); // can't move full distance
// so we can run impact function afterwards.
if( trace.pHit && ( !(ent->v.flags & FL_ONGROUND) || ent->v.groundentity != trace.pHit ))
{
SV_Impact( ent, &trace );
}
if( trace.pHit ) SV_Impact( ent, &trace );
return trace;
}
@ -1016,7 +1013,7 @@ void SV_PushMove( edict_t *pusher, float movetime )
continue;
pusher->v.solid = SOLID_NOT;
trace = SV_ClipMoveToEntity( pusher, check->v.origin, check->v.mins, check->v.maxs, check->v.origin, MASK_SOLID, FTRACE_SIMPLEBOX );
trace = SV_ClipMoveToEntity( pusher, check->v.origin, check->v.mins, check->v.maxs, check->v.origin, MASK_SOLID, FMOVE_SIMPLEBOX );
pusher->v.solid = oldsolid; // was SOLID_BSP
if( !trace.fStartSolid ) continue; // not touched
}

View File

@ -357,7 +357,7 @@ trace_t SV_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3
if( ent == svgame.edicts )
CM_BoxTrace( &trace, start, end, mins, maxs, handle, umask, TR_AABB );
else if( !(flags & FTRACE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
else if( !(flags & FMOVE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
{
if( CM_HitboxTrace( &trace, ent, start, end )); // continue tracing bbox if hitbox missing
else CM_TransformedBoxTrace( &trace, start, end, mins, maxs, handle, umask, origin, angles, TR_AABB );
@ -368,7 +368,7 @@ trace_t SV_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3
if( trace.flFraction < 1.0f || trace.fStartSolid )
trace.pHit = ent;
if( !(flags & FTRACE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
if( !(flags & FMOVE_SIMPLEBOX) && CM_GetModelType( ent->v.modelindex ) == mod_studio )
{
if( VectorIsNull( mins ) && VectorIsNull( maxs ) && trace.iHitgroup == -1 )
{
@ -459,7 +459,7 @@ static void SV_ClipToLinks( areanode_t *node, moveclip_t *clip )
if( !svgame.dllFuncs.pfnShouldCollide( touch, clip->passedict ))
continue;
if( clip->flags & FTRACE_IGNORE_GLASS && CM_GetModelType( touch->v.modelindex ) == mod_brush )
if( clip->flags & FMOVE_IGNORE_GLASS && CM_GetModelType( touch->v.modelindex ) == mod_brush )
{
vec3_t point;

View File

@ -19,7 +19,7 @@
#define LAUNCH_DLL // ignore alias names
#include "launch_api.h"
#define XASH_VERSION 0.68f // current version will be shared across gameinfo struct
#define XASH_VERSION 0.70f // current version will be shared across gameinfo struct
#define MAX_NUM_ARGVS 128
#define MAX_STRING_TOKENS 80

View File

@ -170,7 +170,12 @@ public:
void EXPORT Flicker( void );
void Die( void );
};
LINK_ENTITY_TO_CLASS( func_lamp, CFuncLamp );
// please don't this in current Xash3D version
// lightstyles on arealights currently not supported
// LINK_ENTITY_TO_CLASS( func_lamp, CFuncLamp );
LINK_ENTITY_TO_CLASS( func_lamp, CFuncWall ); // temporary moved here
void CFuncLamp :: Spawn( void )
{
@ -573,12 +578,15 @@ void CFuncMonitor :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
pev->body = 0;
pev->frame = 0;
}
else if (useType == USE_SET)
else if ( useType == USE_SET )
{
if(pActivator->IsPlayer())
if( pActivator->IsPlayer())
{
if( value ) UTIL_SetView(pActivator, iStringNull, 0 );
else if(pev->body)
if ( value )
{
UTIL_SetView( pActivator, iStringNull, 0 );
}
else if ( pev->body )
{
UTIL_SetView( pev->target, CAMERA_ON );
m_pController = (CBasePlayer*)pActivator;

View File

@ -321,7 +321,6 @@ void CInfoPath :: Spawn( void )
m_iState = STATE_ON;
m_index = 0;
SetBits( pFlags, PF_POINTENTITY );
UTIL_SetModel( ENT( pev ), "blabla.mdl");
pev->scale = 0.1f;
}

View File

@ -651,6 +651,7 @@ public:
int m_cTargets;// the total number of targets in this manager's fire list.
int m_index; // Current target
int m_iTargetName [ MAX_MULTI_TARGETS ];// list if indexes into global string array
int m_iTargetNumber [ MAX_MULTI_TARGETS ];// list of target numbers
};
LINK_ENTITY_TO_CLASS( logic_switcher, CSwitcher );
@ -659,6 +660,7 @@ TYPEDESCRIPTION CSwitcher::m_SaveData[] =
{ DEFINE_FIELD( CSwitcher, m_cTargets, FIELD_INTEGER ),
DEFINE_FIELD( CSwitcher, m_index, FIELD_INTEGER ),
DEFINE_ARRAY( CSwitcher, m_iTargetName, FIELD_STRING, MAX_MULTI_TARGETS ),
DEFINE_ARRAY( CSwitcher, m_iTargetNumber, FIELD_INTEGER, MAX_MULTI_TARGETS ),
};IMPLEMENT_SAVERESTORE(CSwitcher, CBaseLogic);
void CSwitcher :: KeyValue( KeyValueData *pkvd )
@ -681,6 +683,7 @@ void CSwitcher :: KeyValue( KeyValueData *pkvd )
char tmp[128];
UTIL_StripToken( pkvd->szKeyName, tmp );
m_iTargetName [ m_cTargets ] = ALLOC_STRING( tmp );
m_iTargetNumber [ m_cTargets ] = atoi( pkvd->szValue );
m_cTargets++;
pkvd->fHandled = TRUE;
}
@ -688,49 +691,59 @@ void CSwitcher :: KeyValue( KeyValueData *pkvd )
void CSwitcher :: Spawn( void )
{
int r_index = 0;
int w_index = m_cTargets - 1;
// Sort targets
// Quick and dirty bubble sort
int swapped = 1;
while(r_index < w_index)
while ( swapped )
{
//we store target with right index in tempname
int name = m_iTargetName [r_index];
//target with right name is free, record new value from wrong name
m_iTargetName [r_index] = m_iTargetName [w_index];
//ok, we can swap targets
m_iTargetName [w_index] = name;
r_index++;
w_index--;
swapped = 0;
for ( int i = 1; i < m_cTargets; i++ )
{
if ( m_iTargetNumber[i] < m_iTargetNumber[i-1] )
{
// Swap out of order elements
int name = m_iTargetName[i];
int number = m_iTargetNumber[i];
m_iTargetName[i] = m_iTargetName[i-1];
m_iTargetNumber[i] = m_iTargetNumber[i-1];
m_iTargetName[i-1] = name;
m_iTargetNumber[i-1] = number;
swapped = 1;
}
}
}
m_iState = STATE_OFF;
m_index = 0;
if(pev->spawnflags & SF_START_ON)
if ( pev->spawnflags & SF_START_ON )
{
m_iState = STATE_ON;
SetNextThink (m_flDelay);
SetNextThink ( m_flDelay );
}
}
void CSwitcher :: Think ( void )
{
if(pev->button == MODE_INCREMENT)//increase target number
if ( pev->button == MODE_INCREMENT )
{
// increase target number
m_index++;
if(m_index >= m_cTargets) m_index = 0;
if( m_index >= m_cTargets )
m_index = 0;
}
else if(pev->button == MODE_DECREMENT)
else if ( pev->button == MODE_DECREMENT )
{
m_index--;
if(m_index < 0) m_index = m_cTargets - 1;
if( m_index < 0 )
m_index = m_cTargets - 1;
}
else if(pev->button == MODE_RANDOM_VALUE)
else if ( pev->button == MODE_RANDOM_VALUE )
{
m_index = RANDOM_LONG (0, m_cTargets - 1);
m_index = RANDOM_LONG( 0, m_cTargets - 1 );
}
SetNextThink (m_flDelay);
SetNextThink ( m_flDelay );
}
void CSwitcher :: Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )

View File

@ -230,9 +230,6 @@ void CAmbientGeneric :: Spawn( void )
m_fLooping = TRUE;
Precache( );
SetObjectClass( ED_AMBIENT );
UTIL_SetOrigin( this, pev->origin ); // need to relink for complete registration
}
// this function needs to be called when the game is loaded, not just when the entity spawns.

View File

@ -3871,15 +3871,19 @@ void CBasePlayer :: UpdateClientData( void )
{
int indexToSend;
//we can entity to look at
if(pViewEnt)indexToSend = pViewEnt->entindex();
else //just reset camera
// we can entity to look at
if( pViewEnt && ( viewFlags & CAMERA_ON ))
{
indexToSend = pViewEnt->entindex();
}
else
{
// just reset camera
indexToSend = 0;
viewFlags = 0; //clear possibly ACTIVE flag
}
MESSAGE_BEGIN(MSG_ONE, gmsg.CamData, NULL, pev);
MESSAGE_BEGIN( MSG_ONE, gmsg.CamData, NULL, pev );
WRITE_SHORT( indexToSend );
WRITE_SHORT( viewFlags );
MESSAGE_END();

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /c
# ADD CPP /nologo /MD /W3 /O2 /I "./" /I "ents" /I "game" /I "global" /I "monsters" /I "../common" /I "../game_shared" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "./" /I "ents" /I "game" /I "global" /I "monsters" /I "../common" /I "../game_shared" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32

View File

@ -292,27 +292,6 @@ static void S_PlayChannel( channel_t *ch, sfx_t *sfx )
palSourcei( ch->sourceNum, AL_LOOPING, false );
palSourcei( ch->sourceNum, AL_SOURCE_RELATIVE, false );
palSourcei( ch->sourceNum, AL_SAMPLE_OFFSET, 0 );
if( ch->use_loop )
{
if( ch->sfx->loopStart >= 0 )
{
if( ch->state == CHAN_FIRSTPLAY )
{
// play first from start, then from loopOffset
ch->state = CHAN_LOOPED;
}
else if( ch->state == CHAN_LOOPED )
{
palSourcei( ch->sourceNum, AL_SAMPLE_OFFSET, sfx->loopStart );
}
}
else
{
ch->state = CHAN_LOOPED;
palSourcei( ch->sourceNum, AL_LOOPING, true );
}
}
palSourcePlay( ch->sourceNum );
}
@ -522,7 +501,7 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, float vol, int pitch, i
if( flags & SND_CHANGE_VOL )
ch->volume = vol;
if( flags & SND_STOP )
if( flags & SND_STOP && ch->sfx->loopStart >= 0 )
S_StopChannel( ch );
return true;
@ -544,7 +523,7 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, float vol, int pitch, i
if( flags & SND_CHANGE_VOL )
ch->volume = vol;
if( flags & SND_STOP )
if( flags & SND_STOP && ch->sfx->loopStart >= 0 )
S_StopChannel( ch );
return true;
@ -608,7 +587,6 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
target_chan->entchannel = chan;
target_chan->isSentence = false;
target_chan->dist_mult = (attn / 1000.0f);
target_chan->state = CHAN_FIRSTPLAY;
target_chan->sfx = sfx;
target_chan->pitch = pitch / (float)PITCH_NORM;
@ -684,7 +662,6 @@ void S_StaticSound( const vec3_t pos, int ent, int chan, sound_t handle, float f
ch->entnum = ent;
ch->entchannel = chan;
ch->startTime = Sys_Milliseconds();
ch->state = CHAN_FIRSTPLAY;
VectorCopy( pos, ch->position );
ch->volume = vol;
ch->entnum = ent;

View File

@ -30,13 +30,6 @@ typedef enum
S_EXTCOUNT
} s_openal_extensions;
enum
{
CHAN_FIRSTPLAY,
CHAN_LOOPED,
CHAN_NORMAL,
};
typedef struct sfx_s
{
string name;
@ -76,7 +69,6 @@ typedef struct
typedef struct
{
sfx_t *sfx; // NULL if unused
int state; // channel state
int entnum; // to allow overriding a specific sound
int entchannel;

View File

@ -4580,6 +4580,7 @@ void CEnvMirror :: Spawn( void )
{
// setup mirror
SetObjectClass( ED_PORTAL );
UTIL_SetOrigin( this, pev->origin );
pev->modelindex = 1; // world
pev->oldorigin = pev->origin;
}

View File

@ -4110,17 +4110,17 @@ void CBasePlayer :: UpdateClientData( void )
//try to find entity by targetname
CBaseEntity *pViewEnt = UTIL_FindEntityByString( NULL, "targetname", STRING(viewEntity) );
if (!FNullEnt(pViewEnt))
if (!FNullEnt( pViewEnt ))
{
indexToSend = pViewEnt->entindex();
if(pViewEnt->pev->flags & FL_MONSTER) viewFlags |= MONSTER_VIEW;
ALERT(at_aiconsole, "Find by name : activated with index %i and flags %i\n", indexToSend, viewFlags);
}
else
{ //try to find entity by classname
{ // try to find entity by classname
CBaseEntity *pViewEnt = UTIL_FindEntityByString( NULL, "classname", STRING(viewEntity) );
if (!FNullEnt(pViewEnt))
if (!FNullEnt( pViewEnt ))
{
indexToSend = pViewEnt->entindex();
@ -4136,6 +4136,12 @@ void CBasePlayer :: UpdateClientData( void )
}
}
if( !( viewFlags & CAMERA_ON ))
{
indexToSend = 0; // inactive
viewFlags = 0; // clear flags
}
MESSAGE_BEGIN(MSG_ONE, gmsgCamData, NULL, pev);
WRITE_SHORT( indexToSend );
WRITE_SHORT( viewFlags );

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
# ADD CPP /nologo /G5 /MT /W3 /O2 /I "..\spirit" /I "..\common" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /G5 /MT /W3 /GX /O2 /I "..\spirit" /I "..\common" /I "..\game_shared" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE MTL /nologo /D "NDEBUG" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32

View File

@ -23,7 +23,7 @@ fopen
Xash 0.71 Beta 05.05.10
1. revision of all resources OK
2. fix sky changelevel bug
2. fix sky changelevel bug OK
3. complete lights.shader
4. implement original half-life dll OK
5. revision monster moving OK
@ -38,4 +38,6 @@ Xash 0.71 Beta 05.05.10
14.re-design sound library OK
15.move loding sounds into launch.dll OK
16.implement generic streaming background track OK
17.check bugs before snapshot
17.check bugs before snapshot OK
18.fix logic_switcher OK
19.implement botman's parabot dll

View File

@ -2836,6 +2836,12 @@ void R_RenderMeshBuffer( const meshbuffer_t *mb )
// other passes are GL_ADD
r_lightmapPasses[0] = *pass;
if( r_lightmapPasses[0].rgbGen.args == NULL )
{
// in cause we crash on breaklight.bsp
r_lightmapPasses[0].rgbGen.args = r_lightmapPassesArgs[0];
}
for( j = 0, l = 0, u = 0; j < LM_STYLES && r_superLightStyle->lightmapStyles[j] != 255; j++ )
{
VectorCopy( r_lightStyles[r_superLightStyle->lightmapStyles[j]].rgb, colorSum );

View File

@ -440,7 +440,7 @@ static void R_BatchMeshBuffer( const meshbuffer_t *mb, const meshbuffer_t *nextm
{
// draw sky
if(!( RI.params & RP_NOSKY ))
R_DrawSky( shader );
R_DrawSky( tr.currentSkyShader );
return;
}
@ -624,7 +624,7 @@ void R_DrawPortals( void )
if( shader->flags & SHADER_SKYPARMS )
{
R_DrawSky( shader );
R_DrawSky( tr.currentSkyShader );
RI.params |= RP_NOSKY;
return;
}

View File

@ -594,7 +594,7 @@ bool R_AddSkySurface( msurface_t *fa )
r_warpface = fa;
r_warpfacevis = false;
if( fa->shader->skySpeed )
if( tr.currentSkyShader && tr.currentSkyShader->skySpeed )
{
// HACK: force full sky to draw when rotating
for( i = 0; i < 6; i++ )

View File

@ -15,6 +15,18 @@ Package=<4>
###############################################################################
Project: "botlib"=".\botlib\botlib.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "bshift"=".\bshift\bshift.dsp" - Package Owner=<4>
Package=<5>

View File

@ -231,22 +231,23 @@ void CreateEntityLights( void )
double vec[4], col[3];
/* go throught entity list and find lights */
for( i = 0; i < numEntities; i++ )
for( i = 0; i < numBSPEntities; i++ )
{
e = &entities[i];
name = ValueForKey( e, "classname" );
environment = false;
junior = false;
// check for lightJunior
if( !com.strnicmp( name, "lightJunior", 11 ))
junior = true;
else if( !com.strnicmp( name, "light_environment", 17 ))
environment = true;
else if( !com.strnicmp( name, "light", 5 ))
junior = false;
else continue;
if( !com.stricmp( name, "light_environment" ))
environment = true;
// lights with target names (and therefore styles) are only parsed from BSP
target = ValueForKey( e, "targetname" );
if( target[0] != '\0' && i >= numBSPEntities )
@ -405,12 +406,15 @@ void CreateEntityLights( void )
sun.next = NULL;
/* make a sun light */
#if 0
CreateSunLight( &sun );
#else
CreateSkyLights( sun.color, intensity, 5, 0.0f, LS_NORMAL );
#endif
/* free original light */
Mem_Free( light );
light = NULL;
/* skip the rest of this love story */
continue;
}