Corrected some parameters
This commit is contained in:
@@ -1,45 +1,42 @@
|
|||||||
-- TODO patient and surgeon will always be the same if we're local... dumb cock
|
function TocCutLocal(_, player, part_name)
|
||||||
|
if TocGetSawInInventory(player) ~= nil then
|
||||||
|
ISTimedActionQueue.add(ISCutLimb:new(player, player, part_name));
|
||||||
function TocCutLocal(_, patient, surgeon, part_name)
|
|
||||||
if TocGetSawInInventory(surgeon) ~= nil then
|
|
||||||
ISTimedActionQueue.add(ISCutLimb:new(patient, surgeon, part_name));
|
|
||||||
else
|
else
|
||||||
surgeon:Say("I don't have a saw on me")
|
player:Say("I don't have a saw on me")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TocOperateLocal(_, patient, surgeon, part_name, use_oven)
|
function TocOperateLocal(_, player, part_name, use_oven)
|
||||||
--local player = getPlayer();
|
--local player = getPlayer();
|
||||||
-- todo add a check if the player has already been amputated or somethin
|
-- todo add a check if the player has already been amputated or somethin
|
||||||
if use_oven then
|
if use_oven then
|
||||||
ISTimedActionQueue.add(ISOperateLimb:new(patient, surgeon, _, part_name, use_oven));
|
ISTimedActionQueue.add(ISOperateLimb:new(player, player, _, part_name, use_oven));
|
||||||
else
|
else
|
||||||
local kit = TocGetKitInInventory(surgeon)
|
local kit = TocGetKitInInventory(player)
|
||||||
if kit ~= nil then
|
if kit ~= nil then
|
||||||
ISTimedActionQueue.add(ISOperateLimb:new(patient, surgeon, kit, part_name, false))
|
ISTimedActionQueue.add(ISOperateLimb:new(player, player, kit, part_name, false))
|
||||||
else
|
else
|
||||||
surgeon:Say("I don't have a kit on me")
|
player:Say("I don't have a kit on me")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TocEquipProsthesisLocal(_, patient, surgeon, part_name)
|
function TocEquipProsthesisLocal(_, player, part_name)
|
||||||
local surgeon_inventory = surgeon:getInventory()
|
local surgeon_inventory = player:getInventory()
|
||||||
local prosthesis_to_equip = surgeon_inventory:getItemFromType('TOC.MetalHand') or
|
local prosthesis_to_equip = surgeon_inventory:getItemFromType('TOC.MetalHand') or
|
||||||
surgeon_inventory:getItemFromType('TOC.MetalHook') or
|
surgeon_inventory:getItemFromType('TOC.MetalHook') or
|
||||||
surgeon_inventory:getItemFromType('TOC.WoodenHook')
|
surgeon_inventory:getItemFromType('TOC.WoodenHook')
|
||||||
if prosthesis_to_equip then
|
if prosthesis_to_equip then
|
||||||
ISTimedActionQueue.add(ISInstallProsthesis:new(surgeon, patient, prosthesis_to_equip, part_name))
|
ISTimedActionQueue.add(ISInstallProsthesis:new(player, player, prosthesis_to_equip, part_name))
|
||||||
else
|
else
|
||||||
surgeon:Say("I need a prosthesis")
|
player:Say("I need a prosthesis")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TocUnequipProsthesisLocal(_, patient, part_name)
|
function TocUnequipProsthesisLocal(_, player, part_name)
|
||||||
--local equipped_prosthesis = TocFindItemInProstBodyLocation(part_name, patient)
|
--local equipped_prosthesis = TocFindItemInProstBodyLocation(part_name, patient)
|
||||||
|
|
||||||
ISTimedActionQueue.add(ISUninstallProsthesis:new(patient, patient, part_name))
|
ISTimedActionQueue.add(ISUninstallProsthesis:new(player, player, part_name))
|
||||||
|
|
||||||
--ISTimedActionQueue.add(ISUninstallProsthesis:new(patient, equipped_prosthesis,
|
--ISTimedActionQueue.add(ISUninstallProsthesis:new(patient, equipped_prosthesis,
|
||||||
-- patient:getBodyDamage():getBodyPart(TocGetBodyPartTypeFromPartName(part_name))))
|
-- patient:getBodyDamage():getBodyPart(TocGetBodyPartTypeFromPartName(part_name))))
|
||||||
|
|||||||
@@ -402,11 +402,11 @@ function TryTocAction(_, part_name, action, surgeon, patient)
|
|||||||
if not isServer() and not isClient() then
|
if not isServer() and not isClient() then
|
||||||
|
|
||||||
if action == "Cut" then
|
if action == "Cut" then
|
||||||
TocCutLocal(_, surgeon, surgeon, part_name)
|
TocCutLocal(_, surgeon, part_name)
|
||||||
elseif action == "Operate" then
|
elseif action == "Operate" then
|
||||||
TocOperateLocal(_, surgeon, surgeon, part_name, false)
|
TocOperateLocal(_, surgeon, part_name, false)
|
||||||
elseif action == "Equip" then
|
elseif action == "Equip" then
|
||||||
TocEquipProsthesisLocal(_, surgeon, surgeon, part_name)
|
TocEquipProsthesisLocal(_, surgeon, part_name)
|
||||||
elseif action == "Unequip" then
|
elseif action == "Unequip" then
|
||||||
TocUnequipProsthesisLocal(_, surgeon, part_name)
|
TocUnequipProsthesisLocal(_, surgeon, part_name)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user