From 468a6c15fadaff8abe2ea486a6b534945c26c646 Mon Sep 17 00:00:00 2001 From: zsilencer Date: Tue, 6 Oct 2015 23:52:37 -0600 Subject: [PATCH] implement peep_give_real_name --- src/peep/peep.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/peep/peep.c b/src/peep/peep.c index 4c5a5a24c4..885c5a8323 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -8459,7 +8459,33 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep *peep, int rideTypeFl */ static void peep_give_real_name(rct_peep *peep) { - RCT2_CALLPROC_X(0x0069C483, 0, 0, 0, 0, (int)peep, 0, 0); + // Generate a name_string_idx from the peep id using bit twiddling + uint32 eax = peep->id + 0xF0B; + uint16 dx = 0; + dx |= ((eax & 0x400) ? 1 : 0) << 13; + dx |= ((eax & 0x2000) ? 1 : 0) << 12; + dx |= ((eax & 0x800) ? 1 : 0) << 11; + dx |= ((eax & 0x400) ? 1 : 0) << 10; + dx |= ((eax & 0x1) ? 1 : 0) << 9; + dx |= ((eax & 0x40) ? 1 : 0) << 8; + dx |= ((eax & 0x2) ? 1 : 0) << 7; + dx |= ((eax & 0x4) ? 1 : 0) << 6; + dx |= ((eax & 0x100) ? 1 : 0) << 5; + dx |= ((eax & 0x20) ? 1 : 0) << 4; + dx |= ((eax & 0x80) ? 1 : 0) << 3; + dx |= ((eax & 0x8) ? 1 : 0) << 2; + dx |= ((eax & 0x200) ? 1 : 0) << 1; + dx |= ((eax & 0x10) ? 1 : 0) << 0; + eax = dx & 0xF; + dx *= 4; + eax *= 4096; + dx += eax; + if (dx < eax) { + dx += 0x1000; + } + dx /= 4; + dx += 0xA000; + peep->name_string_idx = dx; } /**