SixNine
Active Member
- Joined
- Dec 12, 2018
- Messages
- 452
- Reaction score
- 41
This is the crash log - ---------------------------------------------------Signal caught: SIGSEGVT - Pastebin.com (https://pastebin.com/SF1FzZ4f)
const.h value set to #define NETWORKMESSAGE_MAXSIZE 187680
2004 line - NetworkMessage msg = NetworkMessage(getConnection()->getHeader);
const.h value set to #define NETWORKMESSAGE_MAXSIZE 187680
2004 line - NetworkMessage msg = NetworkMessage(getConnection()->getHeader);
C++:
void ProtocolGame::sendMoveCreature(const Creature* creature, const Position& newPos, int32_t newStackPos, const Position& oldPos, int32_t oldStackPos, bool teleport)
{
if (creature == player) {
if (teleport) {
sendRemoveTileCreature(creature, oldPos, oldStackPos);
sendMapDescription(newPos);
} else {
NetworkMessage msg = NetworkMessage(getConnection()->getHeader);
if (oldPos.z == 7 && newPos.z >= 8) {
RemoveTileCreature(msg, creature, oldPos, oldStackPos);
} else {
msg.addByte(0x6D);
if (oldStackPos < 10) {
msg.addPosition(oldPos);
msg.addByte(oldStackPos);
} else {
msg.add<uint16_t>(0xFFFF);
msg.add<uint32_t>(creature->getID());
}
msg.addPosition(newPos);
if (otclientV8) {
msg.add<uint16_t>(creature->getStepDuration(true));
}
}
if (newPos.z > oldPos.z) {
MoveDownCreature(msg, creature, newPos, oldPos);
} else if (newPos.z < oldPos.z) {
MoveUpCreature(msg, creature, newPos, oldPos);
}
if (oldPos.y > newPos.y) { // north, for old x
msg.addByte(0x65);
GetMapDescription(oldPos.x - awareRange.left(), newPos.y - awareRange.top(), newPos.z, awareRange.horizontal(), 1, msg);
} else if (oldPos.y < newPos.y) { // south, for old x
msg.addByte(0x67);
GetMapDescription(oldPos.x - awareRange.left(), newPos.y + awareRange.bottom(), newPos.z, awareRange.horizontal(), 1, msg);
}
if (oldPos.x < newPos.x) { // east, [with new y]
msg.addByte(0x66);
GetMapDescription(newPos.x + awareRange.right(), newPos.y - awareRange.top(), newPos.z, 1, awareRange.vertical(), msg);
} else if (oldPos.x > newPos.x) { // west, [with new y]
msg.addByte(0x68);
GetMapDescription(newPos.x - awareRange.left(), newPos.y - awareRange.top(), newPos.z, 1, awareRange.vertical(), msg);
}
writeToOutputBuffer(msg);
}
} else if (canSee(oldPos) && canSee(creature->getPosition())) {
if (teleport || (oldPos.z == 7 && newPos.z >= 8)) {
sendRemoveTileCreature(creature, oldPos, oldStackPos);
sendAddCreature(creature, newPos, newStackPos, false);
} else {
NetworkMessage msg = NetworkMessage(getConnection()->getHeader);
msg.addByte(0x6D);
if (oldStackPos < 10) {
msg.addPosition(oldPos);
msg.addByte(oldStackPos);
} else {
msg.add<uint16_t>(0xFFFF);
msg.add<uint32_t>(creature->getID());
}
msg.addPosition(creature->getPosition());
if (otclientV8) {
msg.add<uint16_t>(creature->getStepDuration(true));
}
writeToOutputBuffer(msg);
checkPredictiveWalking(oldPos);
checkPredictiveWalking(newPos);
}
} else if (canSee(oldPos)) {
sendRemoveTileCreature(creature, oldPos, oldStackPos);
} else if (canSee(creature->getPosition())) {
sendAddCreature(creature, newPos, newStackPos, false);
}
}