From bd128a1366c22c7bd9a67b9648a96d8d744c246c Mon Sep 17 00:00:00 2001 From: ineed bots Date: Tue, 5 Sep 2023 23:52:16 -0600 Subject: [PATCH] Fix the endswitch opcode --- src/codsrc/clientscript/cscr_vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codsrc/clientscript/cscr_vm.cpp b/src/codsrc/clientscript/cscr_vm.cpp index cb258a2..1fcb73d 100644 --- a/src/codsrc/clientscript/cscr_vm.cpp +++ b/src/codsrc/clientscript/cscr_vm.cpp @@ -2220,7 +2220,7 @@ namespace codsrc void OP_endswitch(game::scriptInstance_t inst) { game::gCaseCount[inst] = game::Scr_ReadUnsignedShort(inst, &game::gFs[inst].pos); - game::Scr_ReadData(inst, &game::gFs[inst].pos, 2 * game::gCaseCount[inst]); + game::Scr_ReadData(inst, &game::gFs[inst].pos, sizeof(unsigned int) * 2 * game::gCaseCount[inst]); // Scr_ReadIntArray } void OP_vector(game::scriptInstance_t inst)