[iortcw] 299/497: SP: Fix fade in on cameras
Simon McVittie
smcv at debian.org
Fri Sep 8 10:37:11 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.42d
in repository iortcw.
commit 27c2437064acaef73e139f8eb9b4b66df360463b
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Wed Feb 18 18:13:43 2015 +0000
SP: Fix fade in on cameras
---
SP/code/cgame/cg_consolecmds.c | 4 ++--
SP/code/cgame/cg_servercmds.c | 9 +++++++--
SP/code/game/g_script.c | 2 ++
SP/code/game/g_script_actions.c | 13 ++++++++++---
4 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/SP/code/cgame/cg_consolecmds.c b/SP/code/cgame/cg_consolecmds.c
index 893ce14..7788a07 100644
--- a/SP/code/cgame/cg_consolecmds.c
+++ b/SP/code/cgame/cg_consolecmds.c
@@ -271,7 +271,7 @@ void CG_StartCamera( const char *name, qboolean startBlack ) {
// return;
COM_StripExtension( name, lname, sizeof(lname) ); //----(SA) added
- strcat( lname, ".camera" );
+ Q_strcat( lname, sizeof( lname ), ".camera" );
if ( trap_loadCamera( CAM_PRIMARY, va( "cameras/%s", lname ) ) ) {
cg.cameraMode = qtrue; // camera on in cgame
@@ -294,7 +294,7 @@ void CG_StartCamera( const char *name, qboolean startBlack ) {
/*
==============
-CG_SopCamera
+CG_StopCamera
==============
*/
void CG_StopCamera( void ) {
diff --git a/SP/code/cgame/cg_servercmds.c b/SP/code/cgame/cg_servercmds.c
index dd16874..7bd2486 100644
--- a/SP/code/cgame/cg_servercmds.c
+++ b/SP/code/cgame/cg_servercmds.c
@@ -818,8 +818,13 @@ static void CG_ServerCommand( void ) {
}
if ( !strcmp( cmd, "startCam" ) ) {
- CG_StartCamera( CG_Argv( 1 ), atoi( CG_Argv( 1 ) ) );
- return;
+ if ( atoi( CG_Argv( 2 ) ) == 1 ) {
+ CG_StartCamera( CG_Argv( 1 ), qtrue );
+ return;
+ } else {
+ CG_StartCamera( CG_Argv( 1 ), qfalse );
+ return;
+ }
}
if ( !strcmp( cmd, "stopCam" ) ) {
diff --git a/SP/code/game/g_script.c b/SP/code/game/g_script.c
index 982531b..70c82b0 100644
--- a/SP/code/game/g_script.c
+++ b/SP/code/game/g_script.c
@@ -64,6 +64,7 @@ qboolean G_ScriptAction_TagConnect( gentity_t *ent, char *params );
qboolean G_ScriptAction_Halt( gentity_t *ent, char *params );
qboolean G_ScriptAction_StopSound( gentity_t *ent, char *params );
qboolean G_ScriptAction_StartCam( gentity_t *ent, char *params );
+qboolean G_ScriptAction_StartCamBlack( gentity_t *ent, char *params );
qboolean G_ScriptAction_EntityScriptName( gentity_t *ent, char *params );
qboolean G_ScriptAction_AIScriptName( gentity_t *ent, char *params );
// DHM - Nerve :: Multiplayer scripting commands
@@ -110,6 +111,7 @@ g_script_stack_action_t gScriptActions[] =
{"halt", G_ScriptAction_Halt},
{"stopsound", G_ScriptAction_StopSound},
{"startcam", G_ScriptAction_StartCam},
+ {"startcamblack", G_ScriptAction_StartCamBlack},
{"entityscriptname", G_ScriptAction_EntityScriptName},
{"aiscriptname", G_ScriptAction_AIScriptName},
// DHM - Nerve :: multiplayer scripting commands start with "wm_" (Wolf Multiplayer)
diff --git a/SP/code/game/g_script_actions.c b/SP/code/game/g_script_actions.c
index 525e964..74a4a4b 100644
--- a/SP/code/game/g_script_actions.c
+++ b/SP/code/game/g_script_actions.c
@@ -1065,10 +1065,10 @@ qboolean G_ScriptAction_StopSound( gentity_t *ent, char *params ) {
===================
G_ScriptAction_StartCam
- syntax: startcam <camera filename>
+ syntax: startcam<black> <camera filename>
===================
*/
-qboolean G_ScriptAction_StartCam( gentity_t *ent, char *params ) {
+qboolean G_ScriptStartCam( gentity_t *ent, char *params, qboolean black ) {
char *pString, *token;
gentity_t *player;
@@ -1086,11 +1086,18 @@ qboolean G_ScriptAction_StartCam( gentity_t *ent, char *params ) {
if ( !player ) {
G_Error( "player not found, perhaps you should give them more time to spawn in" );
}
- trap_SendServerCommand( player->s.number, va( "startCam %s", token ) );
+ trap_SendServerCommand( player->s.number, va( "startCam %s %d", token, (int)black ) );
return qtrue;
}
+qboolean G_ScriptAction_StartCam( gentity_t *ent, char *params ) {
+ return G_ScriptStartCam( ent, params, qfalse );
+}
+qboolean G_ScriptAction_StartCamBlack( gentity_t *ent, char *params ) {
+ return G_ScriptStartCam( ent, params, qtrue );
+}
+
/*
=================
G_ScriptAction_EntityScriptName
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list