mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 01:29:21 +02:00
fix runeFunction
This commit is contained in:
parent
a3cb7f6d32
commit
24f95d7094
@ -1808,34 +1808,37 @@ bool RuneSpell::executeUse(Player* player, Item* item, const Position&, Thing* t
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!scripted) {
|
bool result = false;
|
||||||
return false;
|
if (scripted) {
|
||||||
}
|
LuaVariant var;
|
||||||
|
|
||||||
LuaVariant var;
|
if (needTarget) {
|
||||||
|
var.type = VARIANT_NUMBER;
|
||||||
|
|
||||||
if (needTarget) {
|
if (target == nullptr) {
|
||||||
var.type = VARIANT_NUMBER;
|
Tile* toTile = g_game.map.getTile(toPosition);
|
||||||
|
if (toTile) {
|
||||||
if (target == nullptr) {
|
const Creature* visibleCreature = toTile->getTopCreature();
|
||||||
Tile* toTile = g_game.map.getTile(toPosition);
|
if (visibleCreature) {
|
||||||
if (toTile) {
|
var.number = visibleCreature->getID();
|
||||||
const Creature* visibleCreature = toTile->getTopCreature();
|
}
|
||||||
if (visibleCreature) {
|
|
||||||
var.number = visibleCreature->getID();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
var.number = target->getCreature()->getID();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var.number = target->getCreature()->getID();
|
var.type = VARIANT_POSITION;
|
||||||
|
var.pos = toPosition;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
result = internalCastSpell(player, var, isHotkey);
|
||||||
var.type = VARIANT_POSITION;
|
} else if (runeFunction) {
|
||||||
var.pos = toPosition;
|
result = runeFunction(this, player, toPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!internalCastSpell(player, var, isHotkey)) {
|
if (!result) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user