From 706a5cf188408d40dbc49053c48c4101d5db0a4d Mon Sep 17 00:00:00 2001 From: Hector Franqui Date: Tue, 29 Aug 2017 18:16:48 -0500 Subject: [PATCH] Add occupation name to entity properties. --- npc.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/npc.lua b/npc.lua index e29d3f4..872ee1d 100755 --- a/npc.lua +++ b/npc.lua @@ -457,7 +457,7 @@ function npc.initialize(entity, pos, is_lua_entity, npc_stats, occupation_name) -- Used to calculate dependencies temp_executed_queue = {}, -- An array of schedules, meant to be one per day at some point - --- when calendars are implemented. Allows for only 7 schedules, + -- when calendars are implemented. Allows for only 7 schedules, -- one for each day of the week generic = {}, -- An array of schedules, meant to be for specific dates in the @@ -472,6 +472,9 @@ function npc.initialize(entity, pos, is_lua_entity, npc_stats, occupation_name) -- If occupation name given, override properties with -- occupation values and initialize schedules if occupation_name and occupation_name ~= "" and ent.age == npc.age.adult then + -- Set occupation name + ent.occupation_name = occupation_name + -- Override relevant values npc.occupations.initialize_occupation_values(ent, occupation_name) end