Working MP :)
This commit is contained in:
@@ -31,7 +31,7 @@ end
|
||||
-------------------------
|
||||
|
||||
local function OnServerRelayCommand(module, command, args)
|
||||
if module == CommandsData.modules.TOC_ACTION and ClientRelayCommands[command] then
|
||||
if module == CommandsData.modules.TOC_RELAY and ClientRelayCommands[command] then
|
||||
ClientRelayCommands[command](args)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,14 +45,25 @@ function CutLimbAction:start()
|
||||
self.handler:damageDuringAmputation()
|
||||
else
|
||||
-- Other player
|
||||
---@type relayDamageDuringAmputationParams
|
||||
----@type relayDamageDuringAmputationParams
|
||||
|
||||
|
||||
local params = {patientNum = self.patient:getOnlineID(), limbName = self.limbName}
|
||||
sendClientCommand(CommandsData.modules.TOC_RELAY, CommandsData.server.Relay.RelayDamageDuringAmputation, params )
|
||||
end
|
||||
end
|
||||
|
||||
function CutLimbAction:perform()
|
||||
self.handler:execute()
|
||||
if self.patient == self.character then
|
||||
TOC_DEBUG.print("patient and surgeon are the same, executing on the client")
|
||||
self.handler:execute(true)
|
||||
else
|
||||
TOC_DEBUG.print("patient and surgeon not the same, sending relay to server")
|
||||
-- Other player
|
||||
---@type relayExecuteAmputationActionParams
|
||||
local params = {patientNum = self.patient:getOnlineID(), limbName = self.limbName}
|
||||
sendClientCommand(CommandsData.modules.TOC_RELAY, CommandsData.server.Relay.RelayExecuteAmputationAction, params )
|
||||
end
|
||||
ISBaseTimedAction.perform(self)
|
||||
end
|
||||
|
||||
|
||||
@@ -103,10 +103,10 @@ end
|
||||
function CutLimbHandler:perform(previousAction, itemType)
|
||||
--local item = self:getItemOfType(self.items.ITEMS, itemType)
|
||||
--previousAction = self:toPlayerInventory(item, previousAction)
|
||||
|
||||
-- TODO This is broken like this!
|
||||
local limbName = BodyPartType.ToString(self.bodyPart:getType())
|
||||
TOC_DEBUG.print("perform CutLimbHandler on " .. limbName)
|
||||
local action = CutLimbAction:new(self:getPatient(), self:getDoctor(), limbName)
|
||||
local action = CutLimbAction:new(self:getDoctor(),self:getPatient(), limbName)
|
||||
ISTimedActionQueue.add(action)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user