mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 22:31:36 +00:00
Need to keep prog->entities up to date when spawning entities
This commit is contained in:
parent
919d73b0a0
commit
cf04b5ed01
2 changed files with 3 additions and 1 deletions
2
exec.c
2
exec.c
|
@ -130,6 +130,7 @@ qc_program* prog_load(const char *filename)
|
|||
goto error;
|
||||
}
|
||||
}
|
||||
prog->entities = 1;
|
||||
|
||||
return prog;
|
||||
|
||||
|
@ -226,6 +227,7 @@ qcint prog_spawn_entity(qc_program *prog)
|
|||
printf("Failed to allocate entity\n");
|
||||
return 0;
|
||||
}
|
||||
prog->entities++;
|
||||
for (i = 0; i < prog->entityfields; ++i) {
|
||||
if (!qc_program_entitydata_add(prog, 0)) {
|
||||
printf("Failed to allocate entity\n");
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
case INSTR_ADDRESS:
|
||||
if (OPA->edict < 0 || OPA->edict >= prog->entities)
|
||||
{
|
||||
PRVM_ERROR ("%s Progs attempted to address an out of bounds edict number", PRVM_NAME);
|
||||
PRVM_ERROR ("%s Progs attempted to address an out of bounds edict number %i", PRVM_NAME, OPA->edict);
|
||||
goto cleanup;
|
||||
}
|
||||
if ((unsigned int)(OPB->_int) >= (unsigned int)(prog->entityfields))
|
||||
|
|
Loading…
Reference in a new issue