mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-21 19:41:44 +00:00
Give a more helpful warning when mods try to play empty sound names.
This commit is contained in:
parent
6c4c739175
commit
61a2d3f6e4
3 changed files with 22 additions and 0 deletions
|
@ -661,6 +661,12 @@ static void PF_sound (void)
|
||||||
volume = G_FLOAT(OFS_PARM3) * 255;
|
volume = G_FLOAT(OFS_PARM3) * 255;
|
||||||
attenuation = G_FLOAT(OFS_PARM4);
|
attenuation = G_FLOAT(OFS_PARM4);
|
||||||
|
|
||||||
|
if (!*sample)
|
||||||
|
{
|
||||||
|
PR_RunWarning("PF_sound: empty string\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Spike -- these checks are redundant
|
/* Spike -- these checks are redundant
|
||||||
if (volume < 0 || volume > 255)
|
if (volume < 0 || volume > 255)
|
||||||
Host_Error ("SV_StartSound: volume = %i", volume);
|
Host_Error ("SV_StartSound: volume = %i", volume);
|
||||||
|
|
|
@ -258,6 +258,21 @@ void PR_RunError (const char *error, ...)
|
||||||
Host_Error("Program error");
|
Host_Error("Program error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PR_RunWarning (const char *error, ...)
|
||||||
|
{
|
||||||
|
va_list argptr;
|
||||||
|
char string[1024];
|
||||||
|
|
||||||
|
va_start (argptr, error);
|
||||||
|
q_vsnprintf (string, sizeof(string), error, argptr);
|
||||||
|
va_end (argptr);
|
||||||
|
|
||||||
|
PR_PrintStatement(qcvm->statements + qcvm->xstatement);
|
||||||
|
PR_StackTrace();
|
||||||
|
|
||||||
|
Con_Warning("%s\n", string);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
====================
|
====================
|
||||||
PR_EnterFunction
|
PR_EnterFunction
|
||||||
|
|
|
@ -139,6 +139,7 @@ int NUM_FOR_EDICT(edict_t *e);
|
||||||
extern int type_size[8];
|
extern int type_size[8];
|
||||||
|
|
||||||
FUNC_NORETURN void PR_RunError (const char *error, ...) FUNC_PRINTF(1,2);
|
FUNC_NORETURN void PR_RunError (const char *error, ...) FUNC_PRINTF(1,2);
|
||||||
|
void PR_RunWarning (const char *error, ...) FUNC_PRINTF(1,2);
|
||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
#pragma aux PR_RunError aborts;
|
#pragma aux PR_RunError aborts;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue