I can't seem to pinpoint the cause

This commit is contained in:
Kayne Ruse
2015-04-26 03:11:00 +10:00
parent 7aeabf0d14
commit 63e4394583
9 changed files with 83 additions and 26 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
#config
INCLUDES+=. .. ../client_utilities ../entities ../../common/gameplay ../../common/graphics ../../common/map ../../common/network ../../common/network/packet_types ../../common/ui ../../common/utilities
INCLUDES+=. .. ../client_utilities ../entities ../../common/debugging ../../common/gameplay ../../common/graphics ../../common/map ../../common/network ../../common/network/packet_types ../../common/ui ../../common/utilities
LIBS+=
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
+4 -22
View File
@@ -22,6 +22,7 @@
#include "world.hpp"
#include "channels.hpp"
#include "region_checksum.hpp"
#include <iostream>
@@ -49,16 +50,7 @@ void World::hRegionContent(RegionPacket* const argPacket) {
std::cout << "hRegionContent(" << roomIndex << ", " << argPacket->x << ", " << argPacket->y << ")" << std::endl;
//checksum
int checksum = 0;
for(int i = 0; i < REGION_WIDTH; i++) {
for (int j = 0; j < REGION_HEIGHT; j++) {
for (int k = 0; k < REGION_DEPTH; k++) {
checksum += argPacket->region->GetTile(i, j, k);
}
}
}
if (checksum == 0) {
if (debugRegionSum(argPacket->region) == 0) {
std::cout << "Received checksum failed: " << argPacket->x << ", " << argPacket->y << std::endl;
}
@@ -97,18 +89,8 @@ void World::UpdateMap() {
SendRegionRequest(roomIndex, i, j);
}
else {
Region* region = regionPager.FindRegion(i, j);
int checksum = 0;
for(int x = 0; x < REGION_WIDTH; x++) {
for (int y = 0; y < REGION_HEIGHT; y++) {
for (int z = 0; z < REGION_DEPTH; z++) {
checksum += region->GetTile(x, y, z);
}
}
}
if (checksum == 0) {
//checksum
if (debugRegionSum(regionPager.FindRegion(i, j)) == 0) {
std::cout << "Existing checksum failed: " << roomIndex << ", " << i << ", " << j << std::endl;
}
}