From 836e2b4a8434119669b5c47c53a3ef1e812f7a6f Mon Sep 17 00:00:00 2001 From: GlorifiedPig Date: Wed, 30 Dec 2020 23:45:09 +0200 Subject: [PATCH] fix disastrous bug --- lua/autorun/sh_glorifiedbanking_autoincluder.lua | 2 +- lua/entities/glorifiedbanking_atm/cl_init.lua | 6 +++--- lua/entities/glorifiedbanking_cardreader/cl_init.lua | 2 +- .../modules/core/sv_glorifiedbanking_net.lua | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lua/autorun/sh_glorifiedbanking_autoincluder.lua b/lua/autorun/sh_glorifiedbanking_autoincluder.lua index 9dbee7e..5556c84 100644 --- a/lua/autorun/sh_glorifiedbanking_autoincluder.lua +++ b/lua/autorun/sh_glorifiedbanking_autoincluder.lua @@ -7,7 +7,7 @@ GlorifiedBanking = GlorifiedBanking or { Config = {}, - Version = "3.2.0" + Version = "3.2.1" } print( "[GlorifiedBanking] This server is running version " .. GlorifiedBanking.Version .. "." ) diff --git a/lua/entities/glorifiedbanking_atm/cl_init.lua b/lua/entities/glorifiedbanking_atm/cl_init.lua index 292c5c9..ff3fe42 100644 --- a/lua/entities/glorifiedbanking_atm/cl_init.lua +++ b/lua/entities/glorifiedbanking_atm/cl_init.lua @@ -497,7 +497,7 @@ ENT.Screens[4].onEnterPressed = function(self, amount) self.KeyPadBuffer = "" net.Start("GlorifiedBanking.WithdrawalRequested") - net.WriteUInt(amount, 64) + net.WriteUInt(amount, 32) net.WriteEntity(self) net.SendToServer() end @@ -519,7 +519,7 @@ ENT.Screens[5].onEnterPressed = function(self, amount) self.KeyPadBuffer = "" net.Start("GlorifiedBanking.DepositRequested") - net.WriteUInt(amount, 64) + net.WriteUInt(amount, 32) net.WriteEntity(self) net.SendToServer() end @@ -544,7 +544,7 @@ ENT.Screens[6].onEnterPressed = function(self, amount) end net.Start("GlorifiedBanking.TransferRequested") - net.WriteUInt(amount, 64) + net.WriteUInt(amount, 32) net.WriteEntity(self) net.WriteEntity(self.ScreenData.selected) net.SendToServer() diff --git a/lua/entities/glorifiedbanking_cardreader/cl_init.lua b/lua/entities/glorifiedbanking_cardreader/cl_init.lua index f899712..dd5f2e8 100644 --- a/lua/entities/glorifiedbanking_cardreader/cl_init.lua +++ b/lua/entities/glorifiedbanking_cardreader/cl_init.lua @@ -32,7 +32,7 @@ ENT.Screens[1].onEnterPressed = function(self, amount) self.KeyPadBuffer = "" net.Start("GlorifiedBanking.CardReader.StartTransaction") - net.WriteUInt(amount, 64) + net.WriteUInt(amount, 32) net.WriteEntity(self) net.SendToServer() end diff --git a/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua b/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua index 0d176bb..c121e81 100644 --- a/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua +++ b/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua @@ -52,7 +52,8 @@ local function ValidationChecks( ply, balance, atmEntity ) or balance == nil or balance < 0 or not PlayerAuthChecks( ply ) - or (atmEntity:GetClass() != "glorifiedbanking_atm" and atmEntity:GetClass() != "glorifiedbanking_cardreader") + or not IsValid( atmEntity ) + or ( atmEntity:GetClass() != "glorifiedbanking_atm" and atmEntity:GetClass() != "glorifiedbanking_cardreader" ) or atmEntity.ForcedLoad or not ATMDistanceChecks( ply, atmEntity ) ) end