#include "quakedef.h"
#include "progdefs.h"
+#include "progsvm.h"
#include "clprogdefs.h"
#include "mprogdefs.h"
}
client = svs.clients + clientnum;
- if (!client->netconnection)
- return;
VM_VarString(1, string, sizeof(string));
MSG_WriteChar(&client->message,svc_print);
MSG_WriteString(&client->message, string);
s = PRVM_G_STRING(OFS_PARM0);
- if(!S_LocalSound(s, true))
+ if(!S_LocalSound (s))
{
Con_Printf("VM_localsound: Failed to play %s for %s !\n", s, PRVM_NAME);
PRVM_G_FLOAT(OFS_RETURN) = -4;
if (strcmp(t,s))
continue;
- PRVM_E_FLOAT(ent,chain_of) = PRVM_NUM_FOR_EDICT(chain);
+ PRVM_E_INT(ent,chain_of) = PRVM_NUM_FOR_EDICT(chain);
chain = ent;
}
prog->xfunction->builtinsprofile++;
if (ent->p.e->free)
continue;
- if (E_FLOAT(ent,f) != s)
+ if (PRVM_E_FLOAT(ent,f) != s)
continue;
- PRVM_E_FLOAT(ent,chain_of) = PRVM_NUM_FOR_EDICT(chain);
+ PRVM_E_INT(ent,chain_of) = PRVM_EDICT_TO_PROG(chain);
chain = ent;
}
PRVM_G_INT(OFS_RETURN) = PRVM_G_INT(OFS_PARM0);
VM_CheckEmptyString (s);
- if(!S_PrecacheSound(s,true, true, true))
+ if(!S_PrecacheSound (s,true, true))
Con_Printf("VM_precache_sound: Failed to load %s for %s\n", s, PRVM_NAME);
}
return;
}
- Cvar_Get(name, value, 0);
+ Cvar_Get(name, value, flags);
PRVM_G_FLOAT(OFS_RETURN) = 1; // success
}
{
char *s;
- if(prog->argc < 2)
- PRVM_ERROR("VM_strcat wrong parameter count (min. 2 expected ) !\n");
+ if(prog->argc < 1)
+ PRVM_ERROR("VM_strcat wrong parameter count (min. 1 expected ) !\n");
s = VM_GetTempString();
VM_VarString(0, s, VM_STRINGTEMP_LENGTH);
//void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
void VM_strunzone(void)
{
+ char *str;
VM_SAFEPARMCOUNT(1,VM_strunzone);
- Mem_Free(PRVM_G_STRING(OFS_PARM0));
+ str = PRVM_G_STRING(OFS_PARM0);
+ if( developer.integer && !Mem_IsAllocated( VM_STRINGS_MEMPOOL, str ) )
+ PRVM_ERROR( "VM_strunzone: Zone string already freed in %s!", PRVM_NAME );
+ else
+ Mem_Free( str );
}
/*