darknelson
Member
- Joined
- Jun 19, 2011
- Messages
- 190
- Solutions
- 1
- Reaction score
- 15
i already modified the tile on house, to not be pz, also the spell of summon for can be summoned on house.
this was my line on tile.cpp allow walk monster walk in pz, but
im trying to add this now
but i got an error.
also with this
help please brothers
edit: i find the part of the code can be edited, is on housetile.cpp but for most i try i cant get, this is the original function of tile
how i can modify that part to allow monsters enter with no error? ill try this but give me error
this was my line on tile.cpp allow walk monster walk in pz, but
Lua:
if(monster->getMaster())
return RETURNVALUE_NOERROR;
im trying to add this now
Code:
if(monster->getHouse())
return RETURNVALUE_NOERROR;
but i got an error.
also with this
Code:
if(!houseTile)
return RETURNVALUE_NOERROR;
help please brothers
edit: i find the part of the code can be edited, is on housetile.cpp but for most i try i cant get, this is the original function of tile
Lua:
ReturnValue HouseTile::queryAdd(int32_t index, const Thing& thing, uint32_t count, uint32_t flags, Creature* actor/* = nullptr*/) const
{
if (const Creature* creature = thing.getCreature()) {
if (const Player* player = creature->getPlayer()) {
if (!house->isInvited(player)) {
return RETURNVALUE_PLAYERISNOTINVITED;
}
} else {
return RETURNVALUE_NOTPOSSIBLE;
}
} else if (thing.getItem() && actor) {
Player* actorPlayer = actor->getPlayer();
if (!house->isInvited(actorPlayer)) {
return RETURNVALUE_CANNOTTHROW;
}
}
return Tile::queryAdd(index, thing, count, flags, actor);
}
how i can modify that part to allow monsters enter with no error? ill try this but give me error
Code:
ReturnValue HouseTile::queryAdd(int32_t index, const Thing& thing, uint32_t count, uint32_t flags, Creature* actor/* = nullptr*/) const
{
if (const Creature* creature = thing.getCreature()) {
if (const Player* player = creature->getPlayer()) {
if (!house->isInvited(player)) {
return RETURNVALUE_PLAYERISNOTINVITED;
}
} else {
return RETURNVALUE_NOTPOSSIBLE;
}
} else if (thing.getItem() && actor) {
Player* actorPlayer = actor->getPlayer();
if (!house->isInvited(actorPlayer)) {
return RETURNVALUE_CANNOTTHROW;
}
}
if (const Monster* monster = creature->getMonster()) {
if(monster->getMaster())
return RETURNVALUE_NOERROR;
}
return Tile::queryAdd(index, thing, count, flags, actor);
}
Last edited: