Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3fd213b
Computer resets correct task on bridge fail
Loobinex Sep 26, 2023
17233e6
restored old test code
Loobinex Sep 27, 2023
a651a3e
made it buildable
Loobinex Sep 27, 2023
df1b997
made it functional
Loobinex Sep 27, 2023
faa4773
Merge branch 'master' into wallhugrock
Loobinex Sep 28, 2023
4c0c3ed
!valid hug
Loobinex Sep 28, 2023
1adc6cb
cleanup part 1 out of 26
Loobinex Sep 28, 2023
d7d65fd
cleanup part 2
Loobinex Sep 28, 2023
1c4f862
cleanup 3, removed water specific functions
Loobinex Sep 28, 2023
36a1995
cleanup: removed log messages
Loobinex Sep 28, 2023
6a5f811
cleanup 5 - cleared up a merge error
Loobinex Sep 28, 2023
413169c
cleanup - brackets n stuff
Loobinex Sep 28, 2023
ec0c040
fixed wallhug not working well on dirt
Loobinex Sep 28, 2023
ab414ee
got log messages back
Loobinex Sep 29, 2023
875cbb9
Improved wallhug in liquid
Loobinex Sep 29, 2023
a67148d
Revert "got log messages back"
Loobinex Sep 29, 2023
3a12e95
Give a bit more time on urgent tasks
Loobinex Sep 29, 2023
af1522e
Merge branch 'master' into wallhugrock
Loobinex Oct 11, 2023
250681a
Merge branch 'master' into wallhugrock
Loobinex Oct 17, 2023
30efd01
removed slab_good_for_computer_claim_path function
Loobinex Oct 17, 2023
07fca7f
Merge branch 'master' into wallhugrock
Loobinex Oct 23, 2023
b9274d9
Merge remote-tracking branch 'origin/master' into wallhugrock
Loobinex Oct 11, 2025
c0064f2
Made it build
Loobinex Oct 11, 2025
da0c503
Moved functions back to original file
Loobinex Oct 11, 2025
81ecab4
Added missing bit
Loobinex Oct 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions src/ariadne_wallhug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ long get_next_position_and_angle_required_to_tunnel_creature_to(struct Thing *cr
return 1;
}

SubtlCodedCoords dig_to_position(PlayerNumber plyr_idx, MapSubtlCoord basestl_x, MapSubtlCoord basestl_y, SmallAroundIndex direction_around, TbBool revside)
SubtlCodedCoords dig_to_position(PlayerNumber plyr_idx, MapSubtlCoord basestl_x, MapSubtlCoord basestl_y, SmallAroundIndex direction_around, TbBool revside, unsigned short digflags)
{
long round_change;
SYNCDBG(14,"Starting for subtile (%d,%d)",(int)basestl_x,(int)basestl_y);
Expand All @@ -2012,7 +2012,7 @@ SubtlCodedCoords dig_to_position(PlayerNumber plyr_idx, MapSubtlCoord basestl_x,
{
MapSubtlCoord stl_x = basestl_x + STL_PER_SLB * (int)small_around[round_idx].delta_x;
MapSubtlCoord stl_y = basestl_y + STL_PER_SLB * (int)small_around[round_idx].delta_y;
if (!is_valid_hug_subtile(stl_x, stl_y, plyr_idx))
if (!is_valid_hug_subtile(stl_x, stl_y, plyr_idx, digflags))
{
SYNCDBG(7,"Subtile (%d,%d) accepted",(int)stl_x,(int)stl_y);
SubtlCodedCoords stl_num = get_subtile_number(stl_x, stl_y);
Expand All @@ -2025,7 +2025,7 @@ SubtlCodedCoords dig_to_position(PlayerNumber plyr_idx, MapSubtlCoord basestl_x,

// used only by AI (get_hug_side, tool_dig_to_pos2)
static inline void get_hug_side_next_step(MapSubtlCoord dst_stl_x, MapSubtlCoord dst_stl_y, int dirctn, PlayerNumber plyr_idx,
char *state, MapSubtlCoord *ostl_x, MapSubtlCoord *ostl_y, SmallAroundIndex *round, int *maxdist)
char *state, MapSubtlCoord *ostl_x, MapSubtlCoord *ostl_y, SmallAroundIndex *round, int *maxdist, unsigned short digflags)
{
MapSubtlCoord curr_stl_x = *ostl_x;
MapSubtlCoord curr_stl_y = *ostl_y;
Expand All @@ -2034,7 +2034,7 @@ static inline void get_hug_side_next_step(MapSubtlCoord dst_stl_x, MapSubtlCoord
int dx = small_around[round_idx].delta_x;
int dy = small_around[round_idx].delta_y;
// If we can follow direction straight to the target, and we will get closer to it, then do it
if ((dist <= *maxdist) && !is_valid_hug_subtile(curr_stl_x + STL_PER_SLB*dx, curr_stl_y + STL_PER_SLB*dy, plyr_idx))
if ((dist <= *maxdist) && !is_valid_hug_subtile(curr_stl_x + STL_PER_SLB*dx, curr_stl_y + STL_PER_SLB*dy, plyr_idx, digflags))
{
curr_stl_x += STL_PER_SLB*dx;
curr_stl_y += STL_PER_SLB*dy;
Expand All @@ -2054,7 +2054,7 @@ static inline void get_hug_side_next_step(MapSubtlCoord dst_stl_x, MapSubtlCoord
{
dx = small_around[round_idx].delta_x;
dy = small_around[round_idx].delta_y;
if (!is_valid_hug_subtile(curr_stl_x + STL_PER_SLB*dx, curr_stl_y + STL_PER_SLB*dy, plyr_idx))
if (!is_valid_hug_subtile(curr_stl_x + STL_PER_SLB * dx, curr_stl_y + STL_PER_SLB * dy, plyr_idx, digflags))
{
break;
}
Expand All @@ -2076,12 +2076,11 @@ static inline void get_hug_side_next_step(MapSubtlCoord dst_stl_x, MapSubtlCoord

// used only by AI (get_hug_side, tool_dig_to_pos2)
short get_hug_side_options(MapSubtlCoord src_stl_x, MapSubtlCoord src_stl_y, MapSubtlCoord dst_stl_x, MapSubtlCoord dst_stl_y,
SmallAroundIndex direction, PlayerNumber plyr_idx, MapSubtlCoord *ostla_x, MapSubtlCoord *ostla_y, MapSubtlCoord *ostlb_x, MapSubtlCoord *ostlb_y)
SmallAroundIndex direction, PlayerNumber plyr_idx, MapSubtlCoord *ostla_x, MapSubtlCoord *ostla_y, MapSubtlCoord *ostlb_x, MapSubtlCoord *ostlb_y, unsigned short digflags)
{
SYNCDBG(4,"Starting");

int dist = chessboard_distance(src_stl_x, src_stl_y, dst_stl_x, dst_stl_y);

char state_a = WaHSS_Initial;
MapSubtlCoord stl_a_x = src_stl_x;
MapSubtlCoord stl_a_y = src_stl_y;
Expand All @@ -2101,7 +2100,16 @@ short get_hug_side_options(MapSubtlCoord src_stl_x, MapSubtlCoord src_stl_y, Map
}
if (state_a != WaHSS_Completed)
{
get_hug_side_next_step(dst_stl_x, dst_stl_y, -1, plyr_idx, &state_a, &stl_a_x, &stl_a_y, &round_a, &maxdist_a);
get_hug_side_next_step(dst_stl_x, dst_stl_y, -1, plyr_idx, &state_a, &stl_a_x, &stl_a_y, &round_a, &maxdist_a, digflags);
if (slab_is_liquid(subtile_slab(stl_a_x), subtile_slab(stl_a_y)))
{
// exit path early if water found, so that a bridge will be built here
*ostla_x = stl_a_x;
*ostla_y = stl_a_y;
*ostlb_x = stl_b_x;
*ostlb_y = stl_b_y;
return 1;
}
if ((stl_a_x == dst_stl_x) && (stl_a_y == dst_stl_y)) {
*ostla_x = stl_a_x;
*ostla_y = stl_a_y;
Expand All @@ -2112,7 +2120,16 @@ short get_hug_side_options(MapSubtlCoord src_stl_x, MapSubtlCoord src_stl_y, Map
}
if (state_b != WaHSS_Completed)
{
get_hug_side_next_step(dst_stl_x, dst_stl_y, 1, plyr_idx, &state_b, &stl_b_x, &stl_b_y, &round_b, &maxdist_b);
get_hug_side_next_step(dst_stl_x, dst_stl_y, 1, plyr_idx, &state_b, &stl_b_x, &stl_b_y, &round_b, &maxdist_b, digflags);
if (slab_is_liquid(subtile_slab(stl_b_x), subtile_slab(stl_b_y)))
{
// exit path early if water found, so that a bridge will be built here
*ostla_x = stl_a_x;
*ostla_y = stl_a_y;
*ostlb_x = stl_b_x;
*ostlb_y = stl_b_y;
return 0;
}
if ((stl_b_x == dst_stl_x) && (stl_b_y == dst_stl_y)) {
*ostla_x = stl_a_x;
*ostla_y = stl_a_y;
Expand Down
7 changes: 5 additions & 2 deletions src/ariadne_wallhug.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ enum WallHugSideState {
/******************************************************************************/

/******************************************************************************/

TbBool terrain_toxic_for_creature_at_position(const struct Thing *creatng, MapSubtlCoord stl_x, MapSubtlCoord stl_y);
long slab_wall_hug_route(struct Thing *thing, struct Coord3d *pos, long max_val);
long get_next_position_and_angle_required_to_tunnel_creature_to(struct Thing *creatng, struct Coord3d *pos, PlayerBitFlags crt_owner_flags);
SubtlCodedCoords dig_to_position(PlayerNumber plyr_idx, MapSubtlCoord basestl_x, MapSubtlCoord basestl_y, SmallAroundIndex direction_around, TbBool revside);
SubtlCodedCoords dig_to_position(PlayerNumber plyr_idx, MapSubtlCoord basestl_x, MapSubtlCoord basestl_y, SmallAroundIndex direction_around, TbBool revside, unsigned short digflags);
TbBool slab_good_for_computer_dig_path(const struct SlabMap *slb);
short get_hug_side_options(MapSubtlCoord stl1_x, MapSubtlCoord stl1_y, MapSubtlCoord stl2_x, MapSubtlCoord stl2_y, SmallAroundIndex direction, PlayerNumber plyr_idx,
MapSubtlCoord *ostla_x, MapSubtlCoord *ostla_y, MapSubtlCoord *ostlb_x, MapSubtlCoord *ostlb_y);
MapSubtlCoord *ostla_x, MapSubtlCoord *ostla_y, MapSubtlCoord *ostlb_x, MapSubtlCoord *ostlb_y, unsigned short digflags);

/******************************************************************************/
#define CHECK_SLAB_OWNER (flag_is_set(crt_owner_flags, to_flag(slabmap_owner(slb)))) // return TRUE if the slab's owner is stored in crt_owner_flags
#define IGNORE_SLAB_OWNER_CHECK 0 // crt_owner_flags can be set to 0 to nullify the check for the slab's owner
Expand Down
41 changes: 29 additions & 12 deletions src/player_comptask.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,15 +1565,15 @@ struct ComputerTask * able_to_build_room(struct Computer2 *comp, struct Coord3d
return ctask;
}

short get_hug_side(struct ComputerDig * cdig, MapSubtlCoord stl1_x, MapSubtlCoord stl1_y, MapSubtlCoord stl2_x, MapSubtlCoord stl2_y, unsigned short direction, PlayerNumber plyr_idx)
short get_hug_side(struct ComputerDig * cdig, MapSubtlCoord stl1_x, MapSubtlCoord stl1_y, MapSubtlCoord stl2_x, MapSubtlCoord stl2_y, unsigned short direction, PlayerNumber plyr_idx, unsigned short digflags)
{
SYNCDBG(4,"Starting");
MapSubtlCoord stl_b_x;
MapSubtlCoord stl_b_y;
MapSubtlCoord stl_a_x;
MapSubtlCoord stl_a_y;
int i;
i = get_hug_side_options(stl1_x, stl1_y, stl2_x, stl2_y, direction, plyr_idx, &stl_a_x, &stl_a_y, &stl_b_x, &stl_b_y);
i = get_hug_side_options(stl1_x, stl1_y, stl2_x, stl2_y, direction, plyr_idx, &stl_a_x, &stl_a_y, &stl_b_x, &stl_b_y, digflags);
if ((i == 0) || (i == 1)) {
return i;
}
Expand Down Expand Up @@ -1765,8 +1765,10 @@ ToolDigResult tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * c
MapSubtlCoord digstl_y;
MapSlabCoord digslb_x;
MapSlabCoord digslb_y;
struct SlabMap* action_slb;
ToolDigResult dig_result;
SubtlCodedCoords stl_num;

SYNCDBG(14,"%s: Starting",func_name);
dungeon = comp->dungeon;
// Limit amount of calls
Expand All @@ -1791,7 +1793,7 @@ ToolDigResult tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * c
return dig_result;
}
// Being here means we didn't reached the destination - we must do some kind of action
struct SlabMap* action_slb = get_slabmap_block(subtile_slab(gldstl_x), subtile_slab(gldstl_y));
action_slb = get_slabmap_block(subtile_slab(gldstl_x), subtile_slab(gldstl_y));
if ( (action_slb->kind == SlbT_WATER && computer_check_room_of_role_available(comp, RoRoF_PassWater) == IAvail_Now)||
(action_slb->kind == SlbT_LAVA && computer_check_room_of_role_available(comp, RoRoF_PassLava) == IAvail_Now))
{
Expand All @@ -1815,7 +1817,7 @@ ToolDigResult tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * c
cdig->distance = get_2d_distance(&cdig->pos_next, &cdig->pos_dest);
// In case we're finishing the easy road, prepare vars for long distance digging
cdig->hug_side = get_hug_side(cdig, cdig->pos_next.x.stl.num, cdig->pos_next.y.stl.num,
cdig->pos_dest.x.stl.num, cdig->pos_dest.y.stl.num, around_index, dungeon->owner);
cdig->pos_dest.x.stl.num, cdig->pos_dest.y.stl.num, around_index, dungeon->owner, digflags);
cdig->direction_around = (around_index + (cdig->hug_side < 1 ? 3 : 1)) & 3;
SYNCDBG(5,"%s: Going through slab (%d,%d)",func_name,(int)subtile_slab(gldstl_x),(int)subtile_slab(gldstl_y));
return TDR_DigSlab;
Expand Down Expand Up @@ -1846,10 +1848,10 @@ ToolDigResult tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * c
cdig->last_backwards_step_stl_y = gldstl_y;
cdig->distance = get_2d_distance(&cdig->pos_next, &cdig->pos_dest);
cdig->hug_side = get_hug_side(cdig, cdig->pos_next.x.stl.num, cdig->pos_next.y.stl.num,
cdig->pos_dest.x.stl.num, cdig->pos_dest.y.stl.num, around_index, dungeon->owner);
cdig->pos_dest.x.stl.num, cdig->pos_dest.y.stl.num, around_index, dungeon->owner, digflags);
cdig->direction_around = (around_index + (cdig->hug_side < 1 ? 3 : 1)) & 3;
stl_num = dig_to_position(dungeon->owner, cdig->pos_next.x.stl.num, cdig->pos_next.y.stl.num,
cdig->direction_around, cdig->hug_side);
cdig->direction_around, cdig->hug_side, digflags);
if (stl_num == -1) {
SYNCDBG(5,"%s: Player %d short digging to subtile (%d,%d) preparations failed",func_name,(int)dungeon->owner,(int)cdig->pos_next.x.stl.num,(int)cdig->pos_next.y.stl.num);
return TDR_ToolDigError;
Expand All @@ -1870,7 +1872,7 @@ ToolDigResult tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * c
} else
{
SYNCDBG(4,"%s: Player %d does long distance digging",func_name,(int)dungeon->owner);
stl_num = dig_to_position(dungeon->owner, gldstl_x, gldstl_y, cdig->direction_around, cdig->hug_side);
stl_num = dig_to_position(dungeon->owner, gldstl_x, gldstl_y, cdig->direction_around, cdig->hug_side, digflags);
if (stl_num == -1) {
SYNCDBG(5,"%s: Player %d long digging to subtile (%d,%d) preparations failed",func_name,(int)dungeon->owner,(int)gldstl_x,(int)gldstl_y);
return TDR_ToolDigError;
Expand Down Expand Up @@ -1948,6 +1950,15 @@ ToolDigResult tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * c
SYNCDBG(5,"%s: Reached destination slab (%d,%d)",func_name,(int)digslb_x,(int)digslb_y);
return TDR_ReachedDestination;
}
action_slb = get_slabmap_block(digslb_x, digslb_y);
if (((action_slb->kind == SlbT_WATER && computer_check_room_of_role_available(comp, RoRoF_PassWater) == IAvail_Now) ||
(action_slb->kind == SlbT_LAVA && computer_check_room_of_role_available(comp, RoRoF_PassLava) == IAvail_Now)))
{
cdig->pos_next.y.stl.num = digstl_y;
cdig->pos_next.x.stl.num = digstl_x;
SYNCDBG(5, "%s: Player %d has bridge, so is going through liquid subtile (%d,%d)", func_name, (int)dungeon->owner, (int)gldstl_x, (int)gldstl_y);
return -5;
}
cdig->pos_begin.x.stl.num = digstl_x;
cdig->pos_begin.y.stl.num = digstl_y;
SYNCDBG(5,"%s: Going through slab (%d,%d)",func_name,(int)digslb_x,(int)digslb_y);
Expand Down Expand Up @@ -2085,7 +2096,7 @@ TbBool find_next_gold(struct Computer2 *comp, struct ComputerTask *ctask)
// see if we can reach the gold
do
{
dig_result = tool_dig_to_pos2(comp, &cdig, true, ToolDig_BasicOnly); // actions are simulated
dig_result = tool_dig_to_pos2(comp, &cdig, true, ToolDig_AllowLiquidWBridge); // actions are simulated
SYNCDBG(5,"retval=%d, dig.distance=%ld, dig.calls_count=%ld",
dig_result, cdig.distance, cdig.calls_count);
} while (dig_result == TDR_DigSlab); // loop until we have reached our destination, or an error has occurred
Expand Down Expand Up @@ -2167,8 +2178,7 @@ long task_dig_to_gold(struct Computer2 *comp, struct ComputerTask *ctask)
}
}

ToolDigResult dig_result = tool_dig_to_pos2(comp, &ctask->dig, false, ToolDig_AllowValuable);

ToolDigResult dig_result = tool_dig_to_pos2(comp, &ctask->dig, false, ToolDig_AllowLiquidWBridge);
if (flag_is_set(ctask->flags, ComTsk_AddTrapLocation))
{
add_to_trap_locations(comp, &ctask->dig.pos_next); // add the dug slab to the list of potential trap locations
Expand Down Expand Up @@ -2269,7 +2279,7 @@ long task_dig_to_attack(struct Computer2 *comp, struct ComputerTask *ctask)
}
}
}
ToolDigResult dig_result = tool_dig_to_pos2(comp, &ctask->dig, false, ToolDig_BasicOnly);
ToolDigResult dig_result = tool_dig_to_pos2(comp, &ctask->dig, false, ToolDig_AllowLiquidWBridge);
switch(dig_result)
{
case TDR_ReachedDestination:
Expand Down Expand Up @@ -3086,7 +3096,7 @@ long task_slap_imps(struct Computer2 *comp, struct ComputerTask *ctask)
long task_dig_to_neutral(struct Computer2 *comp, struct ComputerTask *ctask)
{
SYNCDBG(9,"Starting");
ToolDigResult dig_result = tool_dig_to_pos2(comp, &ctask->dig, false, ToolDig_BasicOnly);
ToolDigResult dig_result = tool_dig_to_pos2(comp, &ctask->dig, false, ToolDig_AllowLiquidWBridge);
switch(dig_result)
{
case TDR_DigSlab:
Expand Down Expand Up @@ -3221,6 +3231,11 @@ long task_wait_for_bridge(struct Computer2 *comp, struct ComputerTask *ctask)
}
if (!can_build_room_at_slab(plyr_idx, RoK_BRIDGE, subtile_slab(basestl_x), subtile_slab(basestl_y)))
{
struct SlabMap* slb = get_slabmap_block(subtile_slab(basestl_x), subtile_slab(basestl_y));
if (slabmap_owner(slb) == plyr_idx && slb->kind == SlbT_BRIDGE)
{
return CTaskRet_Unk1;
}
return CTaskRet_Unk4;
}
if (try_game_action(comp, plyr_idx, GA_PlaceRoom, 0, basestl_x, basestl_y, 1, RoK_BRIDGE) > Lb_OK)
Expand All @@ -3231,6 +3246,8 @@ long task_wait_for_bridge(struct Computer2 *comp, struct ComputerTask *ctask)
if (i == 0) {
ERRORLOG("Bad set Task State");
}
ctask->dig.pos_begin.x.val = subtile_coord(basestl_x, 0);
ctask->dig.pos_begin.y.val = subtile_coord(basestl_y, 0);
return CTaskRet_Unk1;
}
return CTaskRet_Unk4;
Expand Down
2 changes: 1 addition & 1 deletion src/player_computer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {
#define GOLD_DEMAND_CHECK_INTERVAL 5000
/** How long to wait for diggers to prepare a place for room before dropping the task and assuming it failed */
#define COMPUTER_DIG_ROOM_TIMEOUT 7500
#define COMPUTER_URGENT_BRIDGE_TIMEOUT 1200
#define COMPUTER_URGENT_BRIDGE_TIMEOUT 1800
#define COMPUTER_TOOL_DIG_LIMIT 356
#define COMPUTER_TOOL_FAILED_DIG_LIMIT 10

Expand Down
16 changes: 10 additions & 6 deletions src/slab_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,28 +263,32 @@ TbBool slab_kind_is_animated(SlabKind slbkind)
return slabst->animated;
}

TbBool slab_good_for_computer_dig_path(const struct SlabMap *slb)
TbBool slab_good_for_computer_dig_path(const struct SlabMap* slb)
{
const struct SlabConfigStats* slabst = get_slab_stats(slb);
if ( any_flag_is_set(slabst->block_flags, (SlbAtFlg_Filled|SlbAtFlg_Digable|SlbAtFlg_Valuable)) || (slb->kind == SlbT_LAVA) )
if (((slabst->block_flags & (SlbAtFlg_Filled | SlbAtFlg_Digable | SlbAtFlg_Valuable)) != 0) || (slb->kind == SlbT_LAVA))
return true;
return false;
}

TbBool is_valid_hug_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx)
TbBool is_valid_hug_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx, unsigned short digflags)
{
struct SlabMap* slb = get_slabmap_for_subtile(stl_x, stl_y);
const struct SlabConfigStats* slabst = get_slab_stats(slb);
if ((slabst->is_diggable) && !slab_kind_is_indestructible(slb->kind))
{
struct Map* mapblk = get_map_block_at(stl_x, stl_y);
if (!flag_is_set(mapblk->flags, SlbAtFlg_Filled) || (slabmap_owner(slb) == plyr_idx)) {
SYNCDBG(17,"Subtile (%d,%d) rejected based on attrs",(int)stl_x,(int)stl_y);
if (((mapblk->flags & SlbAtFlg_Filled) == 0) || (slabmap_owner(slb) == plyr_idx)) {
SYNCDBG(17, "Subtile (%d,%d) rejected based on attrs", (int)stl_x, (int)stl_y);
return false;
}
}
if ((digflags & ToolDig_AllowLiquidWBridge) && slab_kind_is_liquid(slb->kind))
{
return false;
}
if (!slab_good_for_computer_dig_path(slb)) {
SYNCDBG(17,"Subtile (%d,%d) rejected as not good for dig",(int)stl_x,(int)stl_y);
SYNCDBG(17, "Subtile (%d,%d) rejected as not good for dig", (int)stl_x, (int)stl_y);
return false;
}
return true;
Expand Down
3 changes: 1 addition & 2 deletions src/slab_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ TbBool slab_is_liquid(MapSlabCoord slb_x, MapSlabCoord slb_y);
TbBool slab_is_wall(MapSlabCoord slb_x, MapSlabCoord slb_y);
TbBool is_slab_type_walkable(SlabKind slbkind);

TbBool slab_good_for_computer_dig_path(const struct SlabMap *slb);
TbBool is_valid_hug_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx);
TbBool is_valid_hug_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx, unsigned short digflags);

TbBool can_build_room_at_slab(PlayerNumber plyr_idx, RoomKind rkind,
MapSlabCoord slb_x, MapSlabCoord slb_y);
Expand Down