--- deliantra/server/common/time.C 2007/03/17 22:11:22 1.10 +++ deliantra/server/common/time.C 2008/04/21 23:35:24 1.18 @@ -1,29 +1,27 @@ /* - * CrossFire, A Multiplayer game for X-windows + * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team - * Copyright (C) 2002 Mark Wedel & Crossfire Development Team - * Copyright (C) 1992 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen * - * This program is free software; you can redistribute it and/or modify + * Deliantra is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * The authors can be reached via e-mail at + * along with this program. If not, see . + * + * The authors can be reached via e-mail to */ #include -#include #include #include @@ -34,7 +32,7 @@ /* * Gloabal variables: */ -long pticks; +tick_t pticks; static const char *season_name[5] = { "New Year", @@ -77,13 +75,13 @@ void get_tod (timeofday_t * tod) { - unsigned int todtick = runtime * (1. / RUNTIME_PER_HOUR); + unsigned int todtick = (unsigned int)(runtime * (1. / RUNTIME_PER_HOUR)); tod->year = todtick / HOURS_PER_YEAR; tod->month = todtick / HOURS_PER_MONTH % MONTHS_PER_YEAR; tod->day = todtick % HOURS_PER_MONTH / DAYS_PER_MONTH; tod->hour = todtick % HOURS_PER_DAY; - tod->minute = (runtime - todtick * RUNTIME_PER_HOUR) * (60. / RUNTIME_PER_HOUR); + tod->minute = (int)((runtime - todtick * RUNTIME_PER_HOUR) * (60. / RUNTIME_PER_HOUR)); tod->dayofweek = tod->day % DAYS_PER_WEEK; tod->weekofmonth = tod->day / WEEKS_PER_MONTH; @@ -94,7 +92,6 @@ print_tod (object *op) { timeofday_t tod; - get_tod (&tod); char todmsg [1024];