From: Arianna B. <ar...@us...> - 2006-02-19 10:34:22
|
Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19717 Modified Files: modehandler.cpp modehandler.h weather.cpp Log Message: Weather issues Index: modehandler.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/modehandler.cpp,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** modehandler.cpp 18 Feb 2006 14:12:06 -0000 1.168 --- modehandler.cpp 19 Feb 2006 10:34:18 -0000 1.169 *************** *** 804,808 **** break; case psWeatherMessage::LIGHTNING: ! ProcessLighting(msg.weather); break; case psWeatherMessage::FOG: --- 804,808 ---- break; case psWeatherMessage::LIGHTNING: ! ProcessLighting(msg.weather, msg.clientID); break; case psWeatherMessage::FOG: *************** *** 903,910 **** ! void ModeHandler::ProcessLighting(psWeatherMessage::NetWeatherInfo& info) { Debug2( LOG_WEATHER, "Lightning in sector %s",info.sector.GetData()); - // Get the sequence manager csRef<iEngineSequenceManager> seqmgr = CS_QUERY_REGISTRY (object_reg, iEngineSequenceManager); --- 903,909 ---- ! void ModeHandler::ProcessLighting(psWeatherMessage::NetWeatherInfo& info, uint clientnum) { Debug2( LOG_WEATHER, "Lightning in sector %s",info.sector.GetData()); // Get the sequence manager csRef<iEngineSequenceManager> seqmgr = CS_QUERY_REGISTRY (object_reg, iEngineSequenceManager); *************** *** 932,939 **** //We search if the sector has the support for this sequence (lightning) if(!seqmgr->FindSequenceByName(name)) ! { ! Error2("Couldn't apply thunder in sector %s! No sequence for this sector!",info.sector.GetData()); ! psSystemMessage sysMsg( 0, MSG_ERROR, "You cannot have a lightning in this sector." ); ! msghandler->Publish( sysMsg.msg ); return; } --- 931,941 ---- //We search if the sector has the support for this sequence (lightning) if(!seqmgr->FindSequenceByName(name)) ! { ! if(celclient->GetMainActor()->GetID() == clientnum ) //Who did /thunder receives the message ! { ! Notify2(LOG_WEATHER,"Couldn't apply thunder in sector %s! No sequence for this sector!",info.sector.GetData()); ! psSystemMessage sysMsg( 0, MSG_ERROR, "You cannot have a lightning in this sector." ); ! msghandler->Publish( sysMsg.msg ); ! } return; } Index: modehandler.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/modehandler.h,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** modehandler.h 16 Feb 2006 17:59:50 -0000 1.48 --- modehandler.h 19 Feb 2006 10:34:18 -0000 1.49 *************** *** 156,160 **** /* WEATHER FUNCTIONS */ // Controls the weather. ! void ProcessLighting(psWeatherMessage::NetWeatherInfo& info); void ProcessRain(psWeatherMessage::NetWeatherInfo& info,bool frozen); void ProcessFog(psWeatherMessage::NetWeatherInfo& info); --- 156,160 ---- /* WEATHER FUNCTIONS */ // Controls the weather. ! void ProcessLighting(psWeatherMessage::NetWeatherInfo& info, uint clientnum); void ProcessRain(psWeatherMessage::NetWeatherInfo& info,bool frozen); void ProcessFog(psWeatherMessage::NetWeatherInfo& info); Index: weather.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/weather.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** weather.cpp 28 Jan 2006 01:52:43 -0000 1.13 --- weather.cpp 19 Feb 2006 10:34:18 -0000 1.14 *************** *** 421,426 **** //else //It is necessary to get the new sector to which everything is referring to. ! iSector* sector = psengine->GetEngine()->FindSector(parent->sector); ! sector->DisableFog(); applied = false; --- 421,429 ---- //else //It is necessary to get the new sector to which everything is referring to. ! iSector* sector = psengine->GetEngine()->FindSector(parent->sector); ! if (sector) ! { ! sector->DisableFog(); ! } applied = false; |