diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 6fbcf5800..13fdb2ebf 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1632,7 +1632,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ } if(labelPlayerNames[i].mouseClick(x, y) && (activeInputLabel != &labelPlayerNames[i])){ - if(i == clientInterface->getPlayerIndex()){ + if(clientInterface != NULL && i == clientInterface->getPlayerIndex()){ setActiveInputLabel(&labelPlayerNames[i]); } } diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index e92d30103..5fb3f67e4 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -667,7 +667,7 @@ Model *SkillType::getAnimation(float animProgress, const Unit *unit, const AnimationAttributes &attributes = animationAttributes[i]; if(attributes.fromHp != 0 || attributes.toHp != 0) { if(unit->getHp() >= attributes.fromHp && unit->getHp() <= attributes.toHp) { - modelIndex = i; + //modelIndex = i; foundSpecificAnimation = true; filteredAnimations.push_back(i); //printf("SELECTING Model index = %d [%s] model attributes [%d to %d] for unit [%s - %d] with HP = %d\n",i,animations[modelIndex]->getFileName().c_str(),attributes.fromHp,attributes.toHp,unit->getType()->getName().c_str(),unit->getId(),unit->getHp()); diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c index 0074b7bdf..f2964a4bc 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c @@ -170,7 +170,7 @@ int ftpStat(const char* path, ftpPathInfo_S *info) gr = getgrgid(fileInfo.st_gid); if(gr) - strncpy(info->group, gr->gr_name, sizeof(info->group)); + strncpy(info->group, gr->gr_name, sizeof(info->group)-1); else snprintf(info->group, 20,"%04d", fileInfo.st_gid); diff --git a/source/shared_lib/sources/platform/common/base_thread.cpp b/source/shared_lib/sources/platform/common/base_thread.cpp index 656d643b1..1532ae818 100644 --- a/source/shared_lib/sources/platform/common/base_thread.cpp +++ b/source/shared_lib/sources/platform/common/base_thread.cpp @@ -327,7 +327,8 @@ bool BaseThread::shutdownAndWait(BaseThread *pThread) { bool BaseThread::shutdownAndWait() { bool ret = true; BaseThread *pThread = this; - string uniqueID = (pThread != NULL ? pThread->getUniqueID() : "?"); + //string uniqueID = (pThread != NULL ? pThread->getUniqueID() : "?"); + string uniqueID = pThread->getUniqueID(); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] uniqueID [%s]\n",__FILE__,__FUNCTION__,__LINE__,uniqueID.c_str()); if(pThread != NULL) { diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index d884e7f1f..eae0589e8 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1818,9 +1818,9 @@ bool Socket::isConnected() { int err = peek(&tmp, peekDataBytes, false, &lastSocketError); //if(err <= 0 && err != PLATFORM_SOCKET_TRY_AGAIN) { //if(err <= 0 && lastSocketError != 0 && lastSocketError != PLATFORM_SOCKET_TRY_AGAIN) { - if((err < 0 && lastSocketError != PLATFORM_SOCKET_TRY_AGAIN) || (err == 0 && peekDataBytes != 0) || - ((err == 0 || err == -1) && peekDataBytes == 0 && lastSocketError != 0 && lastSocketError != PLATFORM_SOCKET_TRY_AGAIN)) { - + //if((err < 0 && lastSocketError != PLATFORM_SOCKET_TRY_AGAIN) || (err == 0 && peekDataBytes != 0) || + // ((err == 0 || err == -1) && peekDataBytes == 0 && lastSocketError != 0 && lastSocketError != PLATFORM_SOCKET_TRY_AGAIN)) { + if((err < 0 && lastSocketError != PLATFORM_SOCKET_TRY_AGAIN) || (err == 0 && peekDataBytes != 0)) { //printf("IsConnected socket has disconnected sock = %d err = %d lastSocketError = %d\n",sock,err,lastSocketError); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR Peek failed, err = %d for socket: %d, error = %s, lastSocketError = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,getLastSocketErrorFormattedText().c_str(),lastSocketError); if(SystemFlags::VERBOSE_MODE_ENABLED) SystemFlags::OutputDebug(SystemFlags::debugError,"SOCKET DISCONNECTED In [%s::%s Line: %d] ERROR Peek failed, err = %d for socket: %d, error = %s, lastSocketError = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,getLastSocketErrorFormattedText().c_str(),lastSocketError); @@ -2634,9 +2634,9 @@ int UPNP_Tools::upnp_init(void *param) { } if(ServerSocket::cancelUpnpdiscoverThread == true) { - if(devlist != NULL) { - freeUPNPDevlist(devlist); - } + //if(devlist != NULL) { + // freeUPNPDevlist(devlist); + //} devlist = NULL; return result; }