Skip to content

Commit 8a3b92b

Browse files
authored
Merge pull request #1474 from ab9rf/remove-unitst-curse
remove fake `curse` compound in `unitst`
2 parents 10a04ab + 1b95334 commit 8a3b92b

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Template for new versions:
1818

1919
## Fixes
2020
- `gui/gm-unit`: remove reference to ``think_counter``, removed in v51.12
21+
- fixed references to removed ``unit.curse`` compound
2122

2223
## Misc Improvements
2324

devel/export-dt-ini.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ address('physical_attrs',df.unit,'body','physical_attrs')
318318
address('body_size',df.unit,'appearance','body_modifiers')
319319
address('size_info',df.unit,'body','size_info','size_cur')
320320
address('size_base',df.unit,'body','size_info','size_base')
321-
address('curse',df.unit,'curse','name')
322-
address('curse_add_flags1',df.unit,'curse','add_tags1')
323-
address('turn_count',df.unit,'curse','interaction','time_on_site')
321+
address('curse',df.unit,'uwss_display_name_string')
322+
address('curse_add_flags1',df.unit,'uwss_add_caste_flag')
323+
address('turn_count',df.unit,'usable_interaction','time_on_site')
324324
address('souls',df.unit,'status','souls')
325325
address('states',df.unit,'status','misc_traits')
326326
address('labors',df.unit,'status','labors')

devel/make-dt.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ ($$$$)
325325
emit_addr 'physical_attrs',%all,'unit','body.physical_attrs';
326326
emit_addr 'body_size',%all,'unit','appearance.body_modifiers';
327327
emit_addr 'size_info',%all,'unit','body.size_info';
328-
emit_addr 'curse',%all,'unit','curse.name';
329-
emit_addr 'curse_add_flags1',%all,'unit','curse.add_tags1';
330-
emit_addr 'turn_count',%all,'unit','curse.time_on_site';
328+
emit_addr 'curse',%all,'unit','uwss_display_name_sing';
329+
emit_addr 'curse_add_flags1',%all,'unit','uwss_add_caste_flag';
330+
emit_addr 'turn_count',%all,'unit','usable_interaction.time_on_site';
331331
emit_addr 'souls',%all,'unit','status.souls';
332332
emit_addr 'states',%all,'unit','status.misc_traits';
333333
emit_addr 'labors',%all,'unit','status.labors';

dwarf-op.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ local seasons = {
733733
'winter',
734734
}
735735
function GetWave(dwf)
736-
arrival_time = current_tick - dwf.curse.interaction.time_on_site;
736+
arrival_time = current_tick - dwf.useable_interaction.time_on_site;
737737
--print(string.format("Current year %s, arrival_time = %s, ticks_per_year = %s", df.global.cur_year, arrival_time, ticks_per_year))
738738
arrival_year = df.global.cur_year + (arrival_time // ticks_per_year);
739739
arrival_season = 1 + (arrival_time % ticks_per_year) // ticks_per_season;

fix/noexert-exhaustion.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
--Running this script on repeat approximately at least every 350 ticks should prevent NOEXERT units from becoming Tired as a result of Individual Combat Drill.
66

77
function isNoExert(u)
8-
if(u.curse.rem_tags1.NOEXERT) then --tag removal overrides tag addition, so if the NOEXERT tag is removed the unit cannot be NOEXERT.
8+
if(u.uwss_remove_caste_flag.NOEXERT) then --tag removal overrides tag addition, so if the NOEXERT tag is removed the unit cannot be NOEXERT.
99
return false
1010
end
11-
if(u.curse.add_tags1.NOEXERT) then--if the tag hasn't been removed, and the unit has a curse that adds it, they must be NOEXERT.
11+
if(u.uwss_add_caste_flag.NOEXERT) then--if the tag hasn't been removed, and the unit has a curse that adds it, they must be NOEXERT.
1212
return true
1313
end
1414
if(dfhack.units.casteFlagSet(u.race,u.caste, df.caste_raw_flags.NOEXERT)) then --if the tag hasn't been added or removed, but their race and caste has the tag, they're NOEXERT.

immortal-cravings.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ local function unit_loop()
172172
end
173173

174174
local function is_active_caste_flag(unit, flag_name)
175-
return not unit.curse.rem_tags1[flag_name] and
176-
(unit.curse.add_tags1[flag_name] or dfhack.units.casteFlagSet(unit.race, unit.caste, df.caste_raw_flags[flag_name]))
175+
return not unit.uwss_remove_caste_flag[flag_name] and
176+
(unit.uwss_add_caste_flag[flag_name] or dfhack.units.casteFlagSet(unit.race, unit.caste, df.caste_raw_flags[flag_name]))
177177
end
178178

179179
---main loop: look for citizens with personality needs for food/drink but w/o physiological need

starvingdead.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ local function do_decay()
4343
attribute.value = math.floor(attribute.value - (attribute.value * attribute_decay))
4444
end
4545

46-
if unit.curse.interaction.time_on_site > (state.death_threshold * TICKS_PER_MONTH) then
46+
if unit.usable_interaction.time_on_site > (state.death_threshold * TICKS_PER_MONTH) then
4747
unit.animal.vanish_countdown = 1
4848
end
4949
end

0 commit comments

Comments
 (0)