From d30710c317ba01ffd4b40c6372a965f5cd46a613 Mon Sep 17 00:00:00 2001 From: Elson Costa Date: Tue, 23 Apr 2024 10:40:47 -0300 Subject: [PATCH] Moved function to check support outfit to data path. --- .../scripts/creaturescripts/others/login.lua | 8 -------- data/scripts/creaturescripts/player/login.lua | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data-otservbr-global/scripts/creaturescripts/others/login.lua b/data-otservbr-global/scripts/creaturescripts/others/login.lua index 2747496e9ae..8457209e90a 100644 --- a/data-otservbr-global/scripts/creaturescripts/others/login.lua +++ b/data-otservbr-global/scripts/creaturescripts/others/login.lua @@ -37,14 +37,6 @@ function playerLogin.onLogin(player) player:openChannel(0x00) -- guild end end - - local playerOutfit = player:getOutfit() - if table.contains({ 75, 266, 302 }, playerOutfit.lookType) then - playerOutfit.lookType = 136 - playerOutfit.lookAddons = 0 - player:setOutfit(playerOutfit) - end - return true end diff --git a/data/scripts/creaturescripts/player/login.lua b/data/scripts/creaturescripts/player/login.lua index 34d139a047d..c3ad6fa30d4 100644 --- a/data/scripts/creaturescripts/player/login.lua +++ b/data/scripts/creaturescripts/player/login.lua @@ -153,6 +153,14 @@ function playerLoginGlobal.onLogin(player) onMovementRemoveProtection(playerId, player:getPosition(), 10) end + -- Change support outfit to a normal outfit to open customize character without crashes + local playerOutfit = player:getOutfit() + if table.contains({ 75, 266, 302 }, playerOutfit.lookType) then + playerOutfit.lookType = 136 + playerOutfit.lookAddons = 0 + player:setOutfit(playerOutfit) + end + player:initializeLoyaltySystem() player:registerEvent("PlayerDeath") player:registerEvent("DropLoot")