diff --git a/Source/Server/Entities.c b/Source/Server/Entities.c index 043c5d1a..e8c2b6e5 100644 --- a/Source/Server/Entities.c +++ b/Source/Server/Entities.c @@ -61,6 +61,7 @@ void Entities_UseTargets( void ) { entity eOld = self; while ( eFind ) { self = eFind; + bprint( sprintf( "Triggering %s %s\n", self.classname, self.targetname ) ); self.vUse(); eFind = eFind.chain; } diff --git a/Source/Server/FuncBreakable.c b/Source/Server/FuncBreakable.c index a2b1e6ad..9face858 100644 --- a/Source/Server/FuncBreakable.c +++ b/Source/Server/FuncBreakable.c @@ -115,7 +115,7 @@ void func_breakable_die( int iNull ) { Entities_Remove(); } -static void func_breakable_use( void ) { +void func_breakable_use( void ) { func_breakable_die( 0 ); } @@ -139,7 +139,7 @@ void func_breakable_touch( void ) { } } - if ( ( self.spawnflags & SF_PRESSURE ) && other.absmin_z >= self.maxs_z - 2 ) { + if ( ( self.spawnflags & SF_PRESSURE ) && ( other.absmin_z >= self.maxs_z - 2 ) ) { self.think = func_breakable_use; if ( self.delay == 0 ) { @@ -160,7 +160,7 @@ void func_breakable_respawn( void ) { self.iBleeds = FALSE; } - if ( self.spawnflags & SF_TOUCH || self.spawnflags & SF_PRESSURE ) { + if ( ( self.spawnflags & SF_TOUCH ) || ( self.spawnflags & SF_PRESSURE ) ) { self.touch = func_breakable_touch; } diff --git a/Source/Server/FuncPushable.c b/Source/Server/FuncPushable.c index 60732aed..184e9566 100644 --- a/Source/Server/FuncPushable.c +++ b/Source/Server/FuncPushable.c @@ -18,15 +18,32 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* +================= +SPAWN: func_pushable + +Entry function for the brushes that players can push. +Pushables are an extension of breakables, so they mostly +explain themselves. +================= +*/ void func_pushable( void ) { static void func_pushable_touch( void ) { if ( other.classname == "player" ) { func_breakable_touch(); - self.movedir = other.movement; - self.v_angle = other.angles; - } + + if ( other.absmin_z <= self.maxs_z - 2 ) { + self.movedir = other.movement; + self.v_angle = other.angles; + } + } } static void func_pushable_use( void ) { + if ( eActivator.classname != "player" ) { + func_breakable_use(); + return; + } + self.movedir = eActivator.movement; self.v_angle = eActivator.angles; } @@ -35,16 +52,18 @@ void func_pushable( void ) { input_impulse = input_buttons = 0; input_angles = self.v_angle; self.movedir = '0 0 0'; + runstandardplayerphysics( self ); } static void func_pushable_respawn( void ) { func_breakable_respawn(); - self.iUsable = TRUE; + self.solid = SOLID_SLIDEBOX; self.movetype = MOVETYPE_WALK; self.customphysics = func_pushable_physics; self.touch = func_pushable_touch; self.vUse = func_pushable_use; + self.iUsable = TRUE; } func_wall(); diff --git a/Source/Server/Triggers.c b/Source/Server/Triggers.c index bba46063..e7105323 100644 --- a/Source/Server/Triggers.c +++ b/Source/Server/Triggers.c @@ -190,7 +190,7 @@ Attributes: Name (targetname) - Property used to identify entities. Flags: -Multithreaded (1) - See notes below for an explanation. +Multithreaded (1) Notes: There were better ways to do this, but someone thought it was viable to use custom, user defined fields @@ -201,10 +201,39 @@ TODO: Try to find out what garbled mess __fullspawndata is trying to give us ================= */ void multi_manager( void ) { + static void multi_manager_enttrigger( void ) { + Entities_UseTargets(); + remove( self ); + } static void multi_manager_use( void ) { - eprint( self ); + int iFields = tokenize( self.message ); + + for ( int i = 1; i < ( iFields - 1 ); i += 2 ) { + // Sigh, let's attempt to sanitize this + if ( ( argv( i ) != "classname" ) && ( argv( i ) != "origin" ) && ( argv( i ) != "targetname" ) ) { + entity eTemp = spawn(); + eTemp.target = argv( i ); + eTemp.think = multi_manager_enttrigger; + eTemp.nextthink = time + stof( argv( i + 1 ) ); + } + } } self.message = __fullspawndata; self.vUse = multi_manager_use; } + +/* +================= +multisource + +TODO: State crap +================= +*/ +void multisource( void ) { + static void multisource_use( void ) { + Entities_UseTargets(); + } + + self.vUse = multisource_use; +} diff --git a/opencs/progs.dat b/opencs/progs.dat index 0d58de55..3600e87b 100644 Binary files a/opencs/progs.dat and b/opencs/progs.dat differ