From fb6ab4366f64f03699317ce1ac1b80ea65e2bf00 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Sat, 26 Oct 2024 13:38:34 +0200 Subject: [PATCH] Mtn: fix surface validation --- maps/mountain_fortress_v3/ic/functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maps/mountain_fortress_v3/ic/functions.lua b/maps/mountain_fortress_v3/ic/functions.lua index 35dfdc5ab..426502d1c 100644 --- a/maps/mountain_fortress_v3/ic/functions.lua +++ b/maps/mountain_fortress_v3/ic/functions.lua @@ -327,8 +327,8 @@ local function replace_surface(surfaces, entity, index) for k, surface_index in pairs(surfaces) do local surface = game.surfaces[surface_index] local unit_number = entity.unit_number - if tostring(index.saved_entity) == surface.name then - if validate_entity(surface) then + if validate_entity(surface) then + if tostring(index.saved_entity) == surface.name then local car = get_car_by_unit_number(unit_number) surface.name = car.surface_name surfaces[unit_number] = surface.index