Skip to content

Commit

Permalink
Merge pull request #6808 from MahtraDR/go2_remove_personal_wayto_over…
Browse files Browse the repository at this point in the history
…rides

[scripts][go2] Remove personal_wayto_overrides
  • Loading branch information
MahtraDR authored May 3, 2024
2 parents bf991bd + f766348 commit 90f39f9
Showing 1 changed file with 3 additions and 50 deletions.
53 changes: 3 additions & 50 deletions go2.lic
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
original author: Shaelun
game: any
tags: core, movement
version: 1.36
version: 1.37
required: Lich >= 4.6.14
changelog:
1.37 (2024-05-03)
Removing personal wayto overrides, as that functionality has moved to dependency.lic
1.36 (2024-03-03)
Re-supporting the ability to use spaces in custom go2 locations.
1.35 (2023-02-04)
Expand Down Expand Up @@ -175,55 +177,6 @@ show_help = proc {
respond output
}

# For Dragonrealms
# Allows map wayto and timeto overrides in base.yaml and a user's yaml
# Allows custom map targets defined via yaml
if XMLData.game =~ /^DR/
# Get yaml settings
settings = get_settings

# Get base and personal wayto overrides
base_wayto_overrides = settings.base_wayto_overrides
personal_wayto_overrides = settings.personal_wayto_overrides

# Merge the two hashes into a single hash, favoring personal overrides for duplicate keys.
wayto_overrides = base_wayto_overrides.merge(personal_wayto_overrides)

# Iterate through the aggregated map wayto overrides from above and set new stringprocs
wayto_overrides.each do | key, values |
start_room_id = values['start_room'].to_i
end_room_id = values['end_room'].to_i

start_room = Map.list[start_room_id]

old_wayto = start_room.wayto["#{end_room_id}"]
old_timeto = start_room.timeto["#{end_room_id}"]

new_wayto = old_wayto
new_timeto = old_timeto

if values['str_proc']
new_wayto = StringProc.new("#{values['str_proc']}")
end

if values['travel_time']
new_timeto = values['travel_time'].to_f
end

start_room.wayto["#{end_room_id}"] = new_wayto
start_room.timeto["#{end_room_id}"] = new_timeto
end

# Pull personal map custom targets, if any
personal_map_targets = settings.personal_map_targets

if personal_map_targets
custom_targets = (GameSettings['custom targets'] || Hash.new)
custom_targets.merge!(personal_map_targets)
GameSettings['custom targets'] = custom_targets
end
end

change_map_vaalor_shortcut = proc { |use_shortcut|
unless Map.list.any? { |room| room.timeto.any? { |adj_id,time| time.class == Proc and time._dump =~ /$go2_use_vaalor_shortcut/ } }
if use_shortcut
Expand Down

0 comments on commit 90f39f9

Please sign in to comment.