Alright, So, Couple of things to update.
Update your do_setweather and do_showweather functions with the following:
void do_setweather( CHAR_DATA *ch, char *argument )
{
char arg[MIL], arg2[MIL], arg3[MIL], arg4[MIL];
int value, x, y;
argument = one_argument( argument, arg );
argument = one_argument( argument, arg2 );
argument = one_argument( argument, arg3 );
argument = one_argument( argument, arg4 );
if( IS_NPC( ch ) )
{
send_to_char( "Mob's can't setweather.\r\n", ch );
return;
}
if( !ch->desc )
{
send_to_char( "Nice try, but You have no descriptor.\r\n", ch );
return;
}
if( !arg || arg[0] == '\0' || !arg2 || arg2[0] == '\0' || !arg3 || arg3[0] == '\0' )
{
send_to_char( "Syntax: setweather <x> <y> <field> <value>\r\n", ch );
send_to_char( "\r\n", ch );
send_to_char( "Field being one of:\r\n", ch );
send_to_char( " climate hemisphere\r\n", ch );
send_to_char( "Climate value being:\r\n", ch );
send_to_char( " rainforest savanna desert steppe chapparal arctic\r\n", ch );
send_to_char( " grasslands deciduous_forest taiga tundra alpine\r\n", ch );
send_to_char( " See Help Climates for information on each.\r\n", ch );
send_to_char( "Hemisphere value being:\r\n", ch );
send_to_char( " northern southern\r\n", ch );
return;
}
x = atoi( arg );
y = atoi( arg2 );
if( x < 0 || x > WEATHER_SIZE_X )
{
ch_printf( ch, "X value must be between 0 and %d.\r\n", WEATHER_SIZE_X );
return;
}
if( y < 0 || y > WEATHER_SIZE_Y )
{
ch_printf( ch, "Y value must be between 0 and %d.\r\n", WEATHER_SIZE_Y );
return;
}
struct WeatherCell *cell = &weatherMap[x][y];
if( !str_cmp( arg3, "climate" ) )
{
if( !arg4 || arg4[0] == '\0' )
{
send_to_char( "Usage: setweather <x> <y> climate <flag>\r\n", ch );
return;
}
value = get_climate( arg4 );
if( value < 0 || value > MAX_CLIMATE )
ch_printf( ch, "Unknown flag: %s\r\n", arg4 );
else
{
cell->climate = 0;
SET_BIT( cell->climate, 1 << value );
send_to_char( "Cell Climate set.\r\n", ch );
}
return;
}
if( !str_cmp( arg3, "hemisphere" ) )
{
if( !arg4 || arg4[0] == '\0' )
{
send_to_char( "Usage: setweather <x> <y> hemisphere <flag>\r\n", ch );
return;
}
value = get_hemisphere( arg4 );
if( value < 0 || value > HEMISPHERE_MAX )
ch_printf( ch, "Unknown flag: %s\r\n", arg4 );
else
{
cell->hemisphere = 0;
SET_BIT( cell->hemisphere, 1 << value );
send_to_char( "Cell Hemisphere set.\r\n", ch );
}
return;
}
else
{
send_to_char( "Syntax: setweather <x> <y> <field> <value>\r\n", ch );
send_to_char( "\r\n", ch );
send_to_char( "Field being one of:\r\n", ch );
send_to_char( " climate hemisphere\r\n", ch );
send_to_char( "Climate value being:\r\n", ch );
send_to_char( " rainforest savanna desert steppe chapparal arctic\r\n", ch );
send_to_char( " grasslands deciduous_forest taiga tundra alpine\r\n", ch );
send_to_char( " See Help Climates for information on each.\r\n", ch );
send_to_char( "Hemisphere value being:\r\n", ch );
send_to_char( " northern southern\r\n", ch );
return;
}
}
void do_showweather( CHAR_DATA *ch, char *argument )
{
char arg[MIL], arg2[MIL];
int x, y;
argument = one_argument( argument, arg );
argument = one_argument( argument, arg2 );
if( IS_NPC( ch ) )
{
send_to_char( "Mob's can't showweather.\r\n", ch );
return;
}
if( !ch->desc )
{
send_to_char( "Nice try, but You have no descriptor.\r\n", ch );
return;
}
if( !arg || arg[0] == '\0' || !arg2 || arg2[0] == '\0' )
{
send_to_char( "Syntax: showweather <x> <y>\r\n", ch );
return;
}
x = atoi( arg );
y = atoi( arg2 );
if( x < 0 || x > WEATHER_SIZE_X )
{
ch_printf( ch, "X value must be between 0 and %d.\r\n", WEATHER_SIZE_X );
return;
}
if( y < 0 || y > WEATHER_SIZE_Y )
{
ch_printf( ch, "Y value must be between 0 and %d.\r\n", WEATHER_SIZE_Y );
return;
}
struct WeatherCell *cell = &weatherMap[x][y];
ch_printf_color( ch, "Current Weather State for:\r\n" );
ch_printf_color( ch, "&WCell (&w%d&W, &w%d&W)&D\r\n", x, y );
ch_printf_color( ch, "&WClimate: &w%s&D\r\n", flag_string( cell->climate, climate_names ) );
ch_printf_color( ch, "&WHemispere: &w%s&D\r\n", flag_string( cell->hemisphere, hemisphere_name ) );
ch_printf_color( ch, "&WCloud Cover: &w%d&D\r\n", cell->cloudcover );
ch_printf_color( ch, "&WEnergy: &w%d&D\r\n", cell->energy );
ch_printf_color( ch, "&WTemperature: &w%d&D\r\n", cell->temperature );
ch_printf_color( ch, "&WPressure: &w%d&D\r\n", cell->pressure );
ch_printf_color( ch, "&WHumidity: &w%d&D\r\n", cell->humidity );
ch_printf_color( ch, "&WPrecipitation: &w%d&D\r\n", cell->precipitation );
ch_printf_color( ch, "&WWind Speed XAxis: &w%d&D\r\n", cell->windSpeedX );
ch_printf_color( ch, "&WWind Speed YAxis: &w%d&D\r\n", cell->windSpeedY );
}
**Blasted tabbing...
Also, what kind of objections would there be for me to convert this to C++ in the next release update? By C++ I mean, making it into a class, utilizing std::bitset, etc.