From b9bf6e4d7b35aa456eda1496dcfdd709bbbf003b Mon Sep 17 00:00:00 2001 From: ineed bots Date: Tue, 18 Jul 2023 20:50:16 -0600 Subject: [PATCH] some stuff --- maps/bots/_bot.gsc | 9 +++++++++ maps/bots/_bot_internal.gsc | 8 ++++---- maps/bots/_bot_utility.gsc | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/maps/bots/_bot.gsc b/maps/bots/_bot.gsc index d97cc9d..ebafa7a 100644 --- a/maps/bots/_bot.gsc +++ b/maps/bots/_bot.gsc @@ -107,6 +107,15 @@ init() level.bot_allowed_negotiation_links[ level.bot_allowed_negotiation_links.size ] = "zombie_jump_down_184"; level.bot_allowed_negotiation_links[ level.bot_allowed_negotiation_links.size ] = "zombie_jump_down_190"; + level.bot_ignore_links = []; + + switch ( level.script ) + { + case "nazi_zombie_sumpf": + + break; + } + level.players = []; level.bots = []; diff --git a/maps/bots/_bot_internal.gsc b/maps/bots/_bot_internal.gsc index 053a887..c071fc3 100644 --- a/maps/bots/_bot_internal.gsc +++ b/maps/bots/_bot_internal.gsc @@ -1767,14 +1767,14 @@ getRandomLargestStafe( dist ) */ initAStar( goal ) { - nodes = generatePath( self.origin, goal, self.team, level.bot_allowed_negotiation_links ); + nodes = GenerateThePath( self.origin, goal, self.team ); - if ( !isDefined( nodes ) ) + if ( !isDefined( nodes ) || nodes.size <= 0 ) { //Try again to find a path to the origin using best effort algo - nodes = generatePath( self.origin, goal, self.team, level.bot_allowed_negotiation_links, 192.0 ); + nodes = GenerateThePath( self.origin, goal, self.team, 192.0 ); - if ( !isDefined( nodes ) ) + if ( !isDefined( nodes ) || nodes.size <= 0 ) { self.bot.astar = []; return -1; diff --git a/maps/bots/_bot_utility.gsc b/maps/bots/_bot_utility.gsc index 4c1706f..508bade 100644 --- a/maps/bots/_bot_utility.gsc +++ b/maps/bots/_bot_utility.gsc @@ -1138,20 +1138,20 @@ isWeaponPrimary( weap ) return false; } +/* + Generates the path +*/ +GenerateThePath( from, to, team, best_effort ) +{ + return generatePath( from, to, team, level.bot_allowed_negotiation_links, best_effort, level.bot_ignore_links ); +} + /* Checks whether the path generated by the ASTAR path finding is inaccessible */ GetPathIsInaccessible( from, to, team, best_effort ) { - if ( isDefined( best_effort ) ) - { - path = generatePath( from, to, team, level.bot_allowed_negotiation_links, best_effort ); - } - else - { - path = generatePath( from, to, team, level.bot_allowed_negotiation_links ); - } - + path = GenerateThePath( from, to, team, best_effort ); return ( !isDefined( path ) || ( path.size <= 0 ) ); } @@ -1160,7 +1160,7 @@ GetPathIsInaccessible( from, to, team, best_effort ) */ get_path_dist( start, end, team ) { - path = generatePath( start, end, team, level.bot_allowed_negotiation_links, 192.0 ); + path = GenerateThePath( start, end, team, 192.0 ); if ( !isDefined( path ) || path.size <= 0 ) {