From e8a69f39db072abe09abdfb344c595d2169cc578 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Fri, 6 Jun 2025 11:18:50 +0200 Subject: [PATCH] port: fix deformation-related vertex explosions on 64-bit --- src/game/vtxstore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/vtxstore.c b/src/game/vtxstore.c index d82b94304..4b9b7f880 100644 --- a/src/game/vtxstore.c +++ b/src/game/vtxstore.c @@ -58,14 +58,16 @@ void vtxstoreFixRefs(void *find, void *replacement) struct modeldef *modeldef = model->definition; struct modelnode *node = modeldef->rootnode; struct modelrodata_dl *rodata; + struct modelrwdata_dl *rwdata; while (node) { switch (node->type & 0xff) { case MODELNODETYPE_DL: rodata = &node->rodata->dl; + rwdata = (struct modelrwdata_dl *)&model->rwdatas[rodata->rwdataindex]; - if (model->rwdatas[rodata->rwdataindex] == (uintptr_t) find) { - model->rwdatas[rodata->rwdataindex] = (uintptr_t) replacement; + if (rwdata->vertices == find) { + rwdata->vertices = replacement; } break; case MODELNODETYPE_DISTANCE: