From 369a54f836d648745434adfa33ef1ac9464cfae5 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 24 Jul 2023 09:04:11 +0300 Subject: [PATCH] Add critter_flag_set --- src/critter.cc | 18 ++++++++++++++++++ src/critter.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/critter.cc b/src/critter.cc index 4439eb0..50fa5f3 100644 --- a/src/critter.cc +++ b/src/critter.cc @@ -1396,4 +1396,22 @@ bool _critter_flag_check(int pid, int flag) return (proto->critter.data.flags & flag) != 0; } +// 0x42E6F0 +void critter_flag_set(int pid, int flag) +{ + Proto* proto; + + if (pid == -1) { + return; + } + + if (PID_TYPE(pid) != OBJ_TYPE_CRITTER) { + return; + } + + protoGetProto(pid, &proto); + + proto->critter.data.flags |= flag; +} + } // namespace fallout diff --git a/src/critter.h b/src/critter.h index 7423834..ea83f8d 100644 --- a/src/critter.h +++ b/src/critter.h @@ -70,6 +70,7 @@ int critterGetMovementPointCostAdjustedForCrippledLegs(Object* critter, int a2); bool critterIsEncumbered(Object* critter); bool critterIsFleeing(Object* a1); bool _critter_flag_check(int pid, int flag); +void critter_flag_set(int pid, int flag); } // namespace fallout