Skip to content

Commit

Permalink
Fixed showing number of qvm jump table targets (r2180 caused it to sh…
Browse files Browse the repository at this point in the history
…ow 0 on alloc).

git-svn-id: svn://svn.icculus.org/quake3/trunk@2192 edf5b092-35ff-0310-97b2-ce42778d08ea
  • Loading branch information
ztm committed Oct 28, 2011
1 parent 5537b20 commit 6869b8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/qcommon/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,18 +481,20 @@ vmHeader_t *VM_LoadQVM( vm_t *vm, qboolean alloc, qboolean unpure)

if(header.h->vmMagic == VM_MAGIC_VER2)
{
Com_Printf("Loading %d jump table targets\n", vm->numJumpTableTargets);
int previousNumJumpTableTargets = vm->numJumpTableTargets;

header.h->jtrgLength &= ~0x03;

vm->numJumpTableTargets = header.h->jtrgLength >> 2;
Com_Printf("Loading %d jump table targets\n", vm->numJumpTableTargets);

if(alloc)
{
vm->jumpTableTargets = Hunk_Alloc(header.h->jtrgLength, h_high);
vm->numJumpTableTargets = header.h->jtrgLength >> 2;
}
else
{
if((header.h->jtrgLength >> 2) != vm->numJumpTableTargets)
if(vm->numJumpTableTargets != previousNumJumpTableTargets)
{
VM_Free(vm);
FS_FreeFile(header.v);
Expand Down

0 comments on commit 6869b8a

Please sign in to comment.