Doggynub
LUA / C++
- Joined
- Sep 28, 2008
- Messages
- 2,541
- Reaction score
- 186
Well as you may know that this is bugged on tfs 0.4 so i looked around a bit in the code and it was clearly obvious it was messed out so here is the fix.
go to combat.cpp:
find
[cpp]
ReturnValue Combat::canTargetCreature[/cpp]
search in this function block for
[cpp]
if(deny)
return RET_NOERROR;[/cpp]
replace with [cpp]
if(deny)
return RET_YOUARENOTTHEOWNER;//just any thing that isn't related[/cpp]
now go to game.cpp:
find [cpp]bool Game:layerSetAttackedCreature[/cpp]
search in this function block for [cpp]
if(ret != RET_NOERROR)
{
player->sendCancelMessage(ret);
player->sendCancelTarget();
player->setAttackedCreature(NULL);
return false;
}[/cpp]
now replace with
[cpp]
if(ret != RET_NOERROR)
{
if(ret != RET_YOUARENOTTHEOWNER)
player->sendCancelMessage(ret);
player->sendCancelTarget();
player->setAttackedCreature(NULL);
return false;
}[/cpp]
go to combat.cpp:
find
[cpp]
ReturnValue Combat::canTargetCreature[/cpp]
search in this function block for
[cpp]
if(deny)
return RET_NOERROR;[/cpp]
replace with [cpp]
if(deny)
return RET_YOUARENOTTHEOWNER;//just any thing that isn't related[/cpp]
now go to game.cpp:
find [cpp]bool Game:layerSetAttackedCreature[/cpp]
search in this function block for [cpp]
if(ret != RET_NOERROR)
{
player->sendCancelMessage(ret);
player->sendCancelTarget();
player->setAttackedCreature(NULL);
return false;
}[/cpp]
now replace with
[cpp]
if(ret != RET_NOERROR)
{
if(ret != RET_YOUARENOTTHEOWNER)
player->sendCancelMessage(ret);
player->sendCancelTarget();
player->setAttackedCreature(NULL);
return false;
}[/cpp]