From 20c92082cc3523ee11798950d7591719c7d61748 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Thu, 9 Feb 2012 15:20:34 -0500 Subject: [PATCH] doom3: fix demo & allow demo to replay demo file --- neo/framework/FileSystem.cpp | 4 ++-- neo/framework/Session.cpp | 2 +- neo/game/Weapon.cpp | 10 ++++++++++ neo/game/Weapon.h | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/neo/framework/FileSystem.cpp b/neo/framework/FileSystem.cpp index f697d13..794e4b6 100644 --- a/neo/framework/FileSystem.cpp +++ b/neo/framework/FileSystem.cpp @@ -2425,7 +2425,7 @@ void idFileSystemLocal::SetRestrictions( void ) { } } } - cvarSystem->SetCVarBool( "fs_restrict", true ); + cvarSystem->SetCVarBool( "fs_restrict", false ); #endif } @@ -3207,7 +3207,7 @@ idFile *idFileSystemLocal::OpenFileReadFlags( const char *relativePath, int sear continue; } } - + netpath = BuildOSPath( dir->path, dir->gamedir, relativePath ); fp = OpenOSFileCorrectName( netpath, "rb" ); if ( !fp ) { diff --git a/neo/framework/Session.cpp b/neo/framework/Session.cpp index 3201f9b..e2faff9 100644 --- a/neo/framework/Session.cpp +++ b/neo/framework/Session.cpp @@ -2904,7 +2904,7 @@ void idSessionLocal::Init() { // we have a single instance of the main menu #ifndef ID_DEMO_BUILD - guiMainMenu = uiManager->FindGui( "guis/mainmenu.gui", true, false, true ); + guiMainMenu = uiManager->FindGui( "guis/demo_mainmenu.gui", true, false, true ); #else guiMainMenu = uiManager->FindGui( "guis/demo_mainmenu.gui", true, false, true ); #endif diff --git a/neo/game/Weapon.cpp b/neo/game/Weapon.cpp index 738972c..d97774c 100644 --- a/neo/game/Weapon.cpp +++ b/neo/game/Weapon.cpp @@ -390,7 +390,9 @@ void idWeapon::Restore( idRestoreGame *savefile ) { WEAPON_RELOAD.LinkTo( scriptObject, "WEAPON_RELOAD" ); WEAPON_NETRELOAD.LinkTo( scriptObject, "WEAPON_NETRELOAD" ); WEAPON_NETENDRELOAD.LinkTo( scriptObject, "WEAPON_NETENDRELOAD" ); +#ifndef ID_DEMO_BUILD WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" ); +#endif WEAPON_RAISEWEAPON.LinkTo( scriptObject, "WEAPON_RAISEWEAPON" ); WEAPON_LOWERWEAPON.LinkTo( scriptObject, "WEAPON_LOWERWEAPON" ); @@ -544,7 +546,9 @@ void idWeapon::Clear( void ) { WEAPON_RELOAD.Unlink(); WEAPON_NETRELOAD.Unlink(); WEAPON_NETENDRELOAD.Unlink(); +#ifndef ID_DEMO_BUILD WEAPON_NETFIRING.Unlink(); +#endif WEAPON_RAISEWEAPON.Unlink(); WEAPON_LOWERWEAPON.Unlink(); @@ -987,7 +991,9 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) { WEAPON_RELOAD.LinkTo( scriptObject, "WEAPON_RELOAD" ); WEAPON_NETRELOAD.LinkTo( scriptObject, "WEAPON_NETRELOAD" ); WEAPON_NETENDRELOAD.LinkTo( scriptObject, "WEAPON_NETENDRELOAD" ); +#ifndef ID_DEMO_BUILD WEAPON_NETFIRING.LinkTo( scriptObject, "WEAPON_NETFIRING" ); +#endif WEAPON_RAISEWEAPON.LinkTo( scriptObject, "WEAPON_RAISEWEAPON" ); WEAPON_LOWERWEAPON.LinkTo( scriptObject, "WEAPON_LOWERWEAPON" ); @@ -2011,7 +2017,9 @@ void idWeapon::EnterCinematic( void ) { WEAPON_RELOAD = false; WEAPON_NETRELOAD = false; WEAPON_NETENDRELOAD = false; +#ifndef ID_DEMO_BUILD WEAPON_NETFIRING = false; +#endif WEAPON_RAISEWEAPON = false; WEAPON_LOWERWEAPON = false; } @@ -2268,6 +2276,7 @@ void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) { bool snapLight = msg.ReadBits( 1 ) != 0; isFiring = msg.ReadBits( 1 ) != 0; +#ifndef ID_DEMO_BUILD // WEAPON_NETFIRING is only turned on for other clients we're predicting. not for local client if ( owner && gameLocal.localClientNum != owner->entityNumber && WEAPON_NETFIRING.IsLinked() ) { @@ -2283,6 +2292,7 @@ void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) { WEAPON_NETFIRING = isFiring; } +#endif if ( snapLight != lightOn ) { Reload(); diff --git a/neo/game/Weapon.h b/neo/game/Weapon.h index aa99038..2b4616d 100644 --- a/neo/game/Weapon.h +++ b/neo/game/Weapon.h @@ -159,7 +159,9 @@ private: idScriptBool WEAPON_RELOAD; idScriptBool WEAPON_NETRELOAD; idScriptBool WEAPON_NETENDRELOAD; +#ifndef ID_DEMO_BUILD idScriptBool WEAPON_NETFIRING; +#endif idScriptBool WEAPON_RAISEWEAPON; idScriptBool WEAPON_LOWERWEAPON; weaponStatus_t status; -- 1.7.7