src/newgrf_station.cpp
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6878 7d1ff2f621c7
child 10210 a2131f7a315d
equal deleted inserted replaced
10179:eec5a7dcbf61 10184:fcf5fb2548eb
     7 #include "variables.h"
     7 #include "variables.h"
     8 #include "tile_cmd.h"
     8 #include "tile_cmd.h"
     9 #include "landscape.h"
     9 #include "landscape.h"
    10 #include "debug.h"
    10 #include "debug.h"
    11 #include "sprite.h"
    11 #include "sprite.h"
    12 #include "station.h"
    12 #include "station_base.h"
    13 #include "station_map.h"
    13 #include "station_map.h"
    14 #include "newgrf.h"
    14 #include "newgrf.h"
    15 #include "newgrf_callbacks.h"
    15 #include "newgrf_callbacks.h"
    16 #include "newgrf_commons.h"
    16 #include "newgrf_commons.h"
    17 #include "newgrf_station.h"
    17 #include "newgrf_station.h"
   103  * @return Number of station classes.
   103  * @return Number of station classes.
   104  */
   104  */
   105 uint GetNumStationClasses()
   105 uint GetNumStationClasses()
   106 {
   106 {
   107 	uint i;
   107 	uint i;
   108 	for (i = 0; i < STAT_CLASS_MAX && _station_classes[i].id != 0; i++);
   108 	for (i = 0; i < STAT_CLASS_MAX && _station_classes[i].id != 0; i++) {}
   109 	return i;
   109 	return i;
   110 }
   110 }
   111 
   111 
   112 /**
   112 /**
   113  * Return the number of stations for the given station class.
   113  * Return the number of stations for the given station class.
   570 	res->callback_param1 = 0;
   570 	res->callback_param1 = 0;
   571 	res->callback_param2 = 0;
   571 	res->callback_param2 = 0;
   572 	res->last_value      = 0;
   572 	res->last_value      = 0;
   573 	res->trigger         = 0;
   573 	res->trigger         = 0;
   574 	res->reseed          = 0;
   574 	res->reseed          = 0;
       
   575 	res->count           = 0;
   575 }
   576 }
   576 
   577 
   577 static const SpriteGroup *ResolveStation(ResolverObject *object)
   578 static const SpriteGroup *ResolveStation(ResolverObject *object)
   578 {
   579 {
   579 	const SpriteGroup *group;
   580 	const SpriteGroup *group;
   723 	st->speclist[specindex].grfid    = 0;
   724 	st->speclist[specindex].grfid    = 0;
   724 	st->speclist[specindex].localidx = 0;
   725 	st->speclist[specindex].localidx = 0;
   725 
   726 
   726 	/* If this was the highest spec index, reallocate */
   727 	/* If this was the highest spec index, reallocate */
   727 	if (specindex == st->num_specs - 1) {
   728 	if (specindex == st->num_specs - 1) {
   728 		for (; st->speclist[st->num_specs - 1].grfid == 0 && st->num_specs > 1; st->num_specs--);
   729 		for (; st->speclist[st->num_specs - 1].grfid == 0 && st->num_specs > 1; st->num_specs--) {}
   729 
   730 
   730 		if (st->num_specs > 1) {
   731 		if (st->num_specs > 1) {
   731 			st->speclist = ReallocT(st->speclist, st->num_specs);
   732 			st->speclist = ReallocT(st->speclist, st->num_specs);
   732 		} else {
   733 		} else {
   733 			free(st->speclist);
   734 			free(st->speclist);