summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2002-04-02 03:34:23 +0000
committerTim Angus <tim@ngus.net>2002-04-02 03:34:23 +0000
commit00970eaaa5759a8bf9c7d9411a56c98ce27b96df (patch)
treeecdee1008ba35b11005647947ebd3d8a019c6406 /src
parentfd4a85fc10aeaea419c6dd00b962a581126e8028 (diff)
General bug fixes
Diffstat (limited to 'src')
-rw-r--r--src/game/g_buildable.c2
-rw-r--r--src/game/g_client.c2
-rw-r--r--src/ui/ui_main.c41
3 files changed, 35 insertions, 10 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 53f42ea2..a6cf9492 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -2162,7 +2162,7 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
built->physicsBounce = BG_FindBounceForBuildable( buildable );
built->s.groundEntityNum = -1;
- if( builder->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING )
+ if( builder->client && builder->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING )
{
if( builder->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING )
VectorSet( normal, 0.0f, 0.0f, -1.0f );
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 8f6678a5..4bb75029 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1535,7 +1535,7 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn )
AngleVectors( spawn_angles, forward, NULL, NULL );
VectorScale( forward, F_VEL, forward );
- VectorAdd( spawn->s.origin2, forward, dir );
+ VectorAdd( spawnPoint->s.origin2, forward, dir );
VectorNormalize( dir );
VectorScale( dir, UP_VEL, client->ps.velocity );
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index ed0e369d..929c1aab 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -3860,6 +3860,7 @@ static void UI_Update(const char *name) {
static void UI_RunMenuScript(char **args) {
const char *name, *name2;
char buff[1024];
+ const char *cmd;
if (String_Parse(args, &name)) {
if (Q_stricmp(name, "StartServer") == 0) {
@@ -4003,35 +4004,59 @@ static void UI_RunMenuScript(char **args) {
else if( Q_stricmp( name, "LoadTeams" ) == 0 )
UI_LoadTremTeams( );
else if( Q_stricmp( name, "JoinTeam" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremTeamList[ uiInfo.tremTeamIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremTeamList[ uiInfo.tremTeamIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadHumanItems" ) == 0 )
UI_LoadTremHumanItems( );
else if( Q_stricmp( name, "SpawnWithHumanItem" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadAlienClasses" ) == 0 )
UI_LoadTremAlienClasses( );
else if( Q_stricmp( name, "SpawnAsAlienClass" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadHumanMCUBuys" ) == 0 )
UI_LoadTremHumanMCUBuys( );
else if( Q_stricmp( name, "BuyFromMCU" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanMCUBuyList[ uiInfo.tremHumanMCUBuyIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremHumanMCUBuyList[ uiInfo.tremHumanMCUBuyIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadHumanMCUSells" ) == 0 )
UI_LoadTremHumanMCUSells( );
else if( Q_stricmp( name, "SellToMCU" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanMCUSellList[ uiInfo.tremHumanMCUSellIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremHumanMCUSellList[ uiInfo.tremHumanMCUSellIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadAlienUpgrades" ) == 0 )
UI_LoadTremAlienUpgrades( );
else if( Q_stricmp( name, "UpgradeToNewClass" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadAlienBuilds" ) == 0 )
UI_LoadTremAlienBuilds( );
else if( Q_stricmp( name, "BuildAlienBuildable" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
else if( Q_stricmp( name, "LoadHumanBuilds" ) == 0 )
UI_LoadTremHumanBuilds( );
else if( Q_stricmp( name, "BuildHumanBuildable" ) == 0 )
- trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd );
+ {
+ if( cmd = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd )
+ trap_Cmd_ExecuteText( EXEC_APPEND, cmd );
+ }
//TA: tremulous menus
else if (Q_stricmp(name, "playMovie") == 0) {