Skip to content

Commit c2d1c62

Browse files
authored
Imps reinforce better and claim disconnected dungeons (dkfans#4862)
1 parent 5929564 commit c2d1c62

4 files changed

Lines changed: 164 additions & 144 deletions

File tree

src/creature_states_spdig.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ long check_out_unreinforced_drop_place(struct Thing *thing)
718718
if ( check_place_to_reinforce(thing, slb_x, slb_y) > 0 )
719719
{
720720
stl_num = get_subtile_number_at_slab_center(slb_x, slb_y);
721-
if ( check_out_uncrowded_reinforce_position(thing, stl_num, &dest_stl_x, &dest_stl_y) )
721+
if ( check_out_uncrowded_reinforce_position(thing, stl_num, &dest_stl_x, &dest_stl_y) > 0)
722722
{
723723
if ( setup_person_move_to_position(thing, dest_stl_x, dest_stl_y, NavRtF_Default) )
724724
{
@@ -962,7 +962,7 @@ short imp_arrives_at_reinforce(struct Thing *spdigtng)
962962

963963
if ( imp_already_reinforcing_at_excluding(spdigtng,spdigtng->mappos.x.stl.num,spdigtng->mappos.y.stl.num))
964964
{
965-
if ( !check_out_uncrowded_reinforce_position(spdigtng, cctrl->digger.working_stl, &stl_x, &stl_y)
965+
if ( check_out_uncrowded_reinforce_position(spdigtng, cctrl->digger.working_stl, &stl_x, &stl_y) <= 0
966966
|| !setup_person_move_to_position(spdigtng, stl_x, stl_y, 0) )
967967
{
968968
internal_set_thing_state(spdigtng, CrSt_ImpLastDidJob);

src/player_compchecks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ long computer_check_for_pretty(struct Computer2 *comp, struct ComputerCheck * ch
665665
if (stack_len <= check->primary_parameter * dungeon->total_area / 100) {
666666
return CTaskRet_Unk4;
667667
}
668-
long n = find_in_imp_stack_starting_at(DigTsk_ImproveDungeon, PLAYER_RANDOM(compdngn->owner, stack_len), dungeon);
668+
long n = find_in_dungeon_imp_stack_starting_at(DigTsk_ImproveDungeon, PLAYER_RANDOM(compdngn->owner, stack_len), dungeon);
669669
if (n < 0) {
670670
return CTaskRet_Unk4;
671671
}

0 commit comments

Comments
 (0)