From: <to...@us...> - 2008-03-01 15:58:23
|
Revision: 1074 http://planeshift.svn.sourceforge.net/planeshift/?rev=1074&view=rev Author: tomtt Date: 2008-03-01 07:58:29 -0800 (Sat, 01 Mar 2008) Log Message: ----------- Added autoincrement to gameTimeDay, gameTimeMonth, and gameTimeYear for later for crop seasons. Modified Paths: -------------- trunk/src/server/weathermanager.cpp Modified: trunk/src/server/weathermanager.cpp =================================================================== --- trunk/src/server/weathermanager.cpp 2008-03-01 15:51:19 UTC (rev 1073) +++ trunk/src/server/weathermanager.cpp 2008-03-01 15:58:29 UTC (rev 1074) @@ -44,6 +44,9 @@ //#define WEATHER_DEBUG +#define MONTH_COUNT 10 +const int monthLengths[MONTH_COUNT] = {32,32,32,32,32,32,32,32,32,32}; + WeatherManager::WeatherManager() { gameTimeMinute = 0; @@ -512,8 +515,17 @@ { gameTimeHour = 0; gameTimeDay++; + if (gameTimeDay >= monthLengths[gameTimeMonth-1]+1) + { + gameTimeDay = 1; + gameTimeMonth++; + if (gameTimeMonth >= MONTH_COUNT+1) + { + gameTimeMonth = 1; + gameTimeYear++; + } + } - // TODO: When duration of day,month,year is desided implement them :) } // Only save every game hour SaveGameTime(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |