Add occupation name to entity properties.

This commit is contained in:
Hector Franqui 2017-08-29 18:16:48 -05:00
parent e85a8161c3
commit 706a5cf188

View File

@ -457,7 +457,7 @@ function npc.initialize(entity, pos, is_lua_entity, npc_stats, occupation_name)
-- Used to calculate dependencies -- Used to calculate dependencies
temp_executed_queue = {}, temp_executed_queue = {},
-- An array of schedules, meant to be one per day at some point -- 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 -- one for each day of the week
generic = {}, generic = {},
-- An array of schedules, meant to be for specific dates in the -- 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 -- If occupation name given, override properties with
-- occupation values and initialize schedules -- occupation values and initialize schedules
if occupation_name and occupation_name ~= "" and ent.age == npc.age.adult then 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) npc.occupations.initialize_occupation_values(ent, occupation_name)
end end