mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
Huge engine change, replace all std::shared_ptrs
Create a new shared pointer type stdext::shared_object_ptr and stdext::shared_obj using boost::intrusive_ptr Advantages: * half memory usage * faster and lightweight Disadvantages: * using weak_ptr is not supported anymore * compiling seems slower
This commit is contained in:
@@ -267,7 +267,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||
|
||||
end
|
||||
|
||||
if lookThing and not lookThing:asCreature() and not lookThing:isNotMoveable() and lookThing:isPickupable() then
|
||||
if lookThing and not lookThing:isCreature() and not lookThing:isNotMoveable() and lookThing:isPickupable() then
|
||||
menu:addSeparator()
|
||||
menu:addOption(tr('Trade with ...'), function() startTradeWith(lookThing) end)
|
||||
end
|
||||
@@ -282,7 +282,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||
if creatureThing then
|
||||
menu:addSeparator()
|
||||
|
||||
if creatureThing:asLocalPlayer() then
|
||||
if creatureThing:isLocalPlayer() then
|
||||
menu:addOption(tr('Set Outfit'), function() g_game.requestOutfit() end)
|
||||
|
||||
if creatureThing:isPartyMember() --[[and not fighting]] then
|
||||
@@ -310,7 +310,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||
menu:addOption(tr('Stop Follow'), function() g_game.cancelFollow() end)
|
||||
end
|
||||
|
||||
if creatureThing:asPlayer() then
|
||||
if creatureThing:isPlayer() then
|
||||
menu:addSeparator()
|
||||
local creatureName = creatureThing:getName()
|
||||
menu:addOption(tr('Message to %s', creatureName), function() g_game.openPrivateChannel(creatureName) end)
|
||||
@@ -322,7 +322,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||
menu:addOption(tr('Add to VIP list'), function() g_game.addVip(creatureName) end)
|
||||
end
|
||||
|
||||
local localPlayerShield = localPlayer:asCreature():getShield()
|
||||
local localPlayerShield = localPlayer:isCreature():getShield()
|
||||
local creatureShield = creatureThing:getShield()
|
||||
|
||||
if localPlayerShield == ShieldNone or localPlayerShield == ShieldWhiteBlue then
|
||||
@@ -394,8 +394,8 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
||||
else
|
||||
if multiUseThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
|
||||
local player = g_game.getLocalPlayer()
|
||||
if multiUseThing:asCreature() and multiUseThing:asCreature() ~= player then
|
||||
g_game.attack(multiUseThing:asCreature())
|
||||
if multiUseThing:isCreature() and multiUseThing:isCreature() ~= player then
|
||||
g_game.attack(multiUseThing:isCreature())
|
||||
return true
|
||||
elseif multiUseThing:isContainer() then
|
||||
if multiUseThing:getParentContainer() then
|
||||
|
@@ -38,7 +38,7 @@ function UIGameMap:onDrop(widget, mousePos)
|
||||
local thingPos = thing:getPosition()
|
||||
if thingPos.x == toPos.x and thingPos.y == toPos.y and thingPos.z == toPos.z then return false end
|
||||
|
||||
if thing:asItem() and thing:getCount() > 1 then
|
||||
if thing:isItem() and thing:getCount() > 1 then
|
||||
modules.game_interface.moveStackableItem(thing, toPos)
|
||||
else
|
||||
g_game.move(thing, toPos, 1)
|
||||
|
Reference in New Issue
Block a user