From 9064a13409c10fa057e57f98957f84985b050e8f Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 28 Oct 2011 19:43:43 +0000 Subject: [PATCH] Fixed showing number of qvm jump table targets (r2180 caused it to show 0 on alloc). --- code/qcommon/vm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/qcommon/vm.c b/code/qcommon/vm.c index 0c03b48c..13e41b03 100644 --- a/code/qcommon/vm.c +++ b/code/qcommon/vm.c @@ -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);