From 7441a448666560987b01fe881b399cdb51faa7df Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Thu, 10 Aug 2023 00:14:39 -0700 Subject: [PATCH] Fix bug where join action wasn't validated anymore --- main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.c b/main.c index 76d6e88..ca56379 100644 --- a/main.c +++ b/main.c @@ -1652,6 +1652,19 @@ MD_String8 is_action_valid(MD_Arena *arena, Entity *from, Action a) error_message = FmtWithLint(arena, "You can't join somebody, you're already in %s's party", characters[gete(from->joined)->npc_kind].name); } + if(error_message.size == 0 && a.kind == ACT_join) + { + bool talk_to_valid = false; + BUFF_ITER(NpcKind, &talk) + { + if(*it == a.argument.targeting) talk_to_valid = true; + } + if(talk_to_valid == false) + { + error_message = FmtWithLint(arena, "Your action_argument for who to join, %s, is either invalid (you can't join nobody) or it's not an NPC that's near you right now.", characters[a.argument.targeting].name); + } + } + if(error_message.size == 0) { AvailableActions available = {0};