src/hcode/btech/map.h File Reference

#include "p.map.bits.h"
#include "p.map.h"
#include "p.map.obj.h"
#include "p.map.dynamic.h"

Include dependency graph for map.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mapobj_struct
struct  MAP

Defines

#define MAX_MECHS_PER_MAP   250
#define MAP_UP   0
#define MAP_DOWN   1
#define MAP_RIGHT   2
#define MAP_LEFT   3
#define MAPX   1000
#define MAPY   1000
#define MAP_NAME_SIZE   30
#define NUM_MAP_LINKS   4
#define DEFAULT_MAP_WIDTH   21
#define DEFAULT_MAP_HEIGHT   11
#define MAP_DISPLAY_WIDTH   21
#define MAP_DISPLAY_HEIGHT   14
#define MAX_ELEV   9
#define GRASSLAND   ' '
#define HEAVY_FOREST   '"'
#define LIGHT_FOREST   '`'
#define WATER   '~'
#define HIGHWATER   '?'
#define ROUGH   '%'
#define MOUNTAINS   '^'
#define ROAD   '#'
#define BUILDING   '@'
#define FIRE   '&'
#define TFIRE   '>'
#define SMOKE   ':'
#define WALL   '='
#define BRIDGE   '/'
#define SNOW   '+'
#define ICE   '-'
#define UNKNOWN_TERRAIN   '$'
#define MAPFLAG_MAPO   1
#define MAPFLAG_SPEC   2
#define MAPFLAG_VACUUM   4
#define MAPFLAG_FIRES   8
#define MAPFLAG_UNDERGROUND   16
#define MAPFLAG_DARK   32
#define MAPFLAG_BRIDGESCS   64
#define MAPFLAG_NOBRIDGIFY   128
#define MAPFLAG_NOFRIENDLYFIRE   256
#define TYPE_FIRE   0
#define TYPE_SMOKE   1
#define TYPE_DEC   2
#define TYPE_LAST_DEC   2
#define TYPE_MINE   3
#define TYPE_BUILD   4
#define TYPE_LEAVE   5
#define TYPE_ENTRANCE   6
#define TYPE_LINKED   7
#define TYPE_BITS   8
#define TYPE_B_LZ   9
#define NUM_MAPOBJTYPES   10
#define BUILDFLAG_CS   1
#define BUILDFLAG_CSI   2
#define BUILDFLAG_DSS   4
#define BUILDFLAG_NOB   8
#define BUILDFLAG_HID   16
#define MapIsCS(map)   (map->buildflag & BUILDFLAG_CSI)
#define BuildIsCS(map)   (map->buildflag & BUILDFLAG_CS)
#define BuildIsHidden(map)   (map->buildflag & (BUILDFLAG_DSS|BUILDFLAG_HID))
#define BuildIsSafe(map)   (map->buildflag & BUILDFLAG_NOB)
#define BuildIsInvis(map)   (map->buildflag & BUILDFLAG_HID)
#define MapUnderSpecialRules(map)   ((map)->flags & MAPFLAG_SPEC)
#define MapGravityMod(map)   (map)->grav
#define MapGravity   MapGravityMod
#define MapIsVacuum(map)   ((map)->flags & MAPFLAG_VACUUM)
#define MapTemperature(map)   (map)->temp
#define MapCloudbase(map)   (map)->cloudbase
#define MapIsUnderground(map)   ((map)->flags & MAPFLAG_UNDERGROUND)
#define MapIsDark(map)   ((map)->flags & MAPFLAG_DARK)
#define MapBridgesCS(map)   ((map)->flags & MAPFLAG_BRIDGESCS)
#define MapNoBridgify(map)   ((map)->flags & MAPFLAG_NOBRIDGIFY)
#define MapNoFriendlyFire(map)   ((map)->flags & MAPFLAG_NOFRIENDLYFIRE)
#define MECHMAPFLAG_MOVED   1
#define MECHLOSFLAG_SEEN   0x0001
#define MECHLOSFLAG_SEESP   0x0002
#define MECHLOSFLAG_SEESS   0x0004
#define MECHLOSFLAG_SEEC2   0x0008
#define MECHLOSFLAG_MNTN   0x0010
#define MECHLOSFLAG_WOOD   0x0020
#define MECHLOSFLAG_WOOD2   0x0040
#define MECHLOSFLAG_WOOD3   0x0080
#define MECHLOSFLAG_WOOD4   0x0100
#define MECHLOSBYTES_WOOD   4
#define MECHLOSMAX_WOOD   16
#define MECHLOSFLAG_WATER   0x0200
#define MECHLOSFLAG_WATER2   0x0400
#define MECHLOSFLAG_WATER3   0x0800
#define MECHLOSBYTES_WATER   3
#define MECHLOSMAX_WATER   8
#define MECHLOSFLAG_PARTIAL   0x1000
#define MECHLOSFLAG_FIRE   0x2000
#define MECHLOSFLAG_SMOKE   0x4000
#define MECHLOSFLAG_BLOCK   0x8000
#define NAVIGATE_LINES   13
#define set_buildflag(a, b)   silly_atr_set((a), A_BUILDFLAG, tprintf("%d", (b)))
#define get_buildflag(a)   atoi(silly_atr_get((a), A_BUILDFLAG))
#define set_buildcf(a, b)   silly_atr_set((a), A_BUILDCF, tprintf("%d %d", (b), (b)))

Typedefs

typedef mapobj_struct mapobj

Functions

void newfreemap (dbref key, void **data, int selector)
void map_update (dbref obj, void *data)


Define Documentation

#define BRIDGE   '/'

Definition at line 56 of file map.h.

Referenced by break_sub(), CalculateLOSFlag(), CheckNavalHeight(), CheckVTOLHeight(), collision_check(), DropGetElevation(), DropSetElevation(), GetTerrainName_base(), growSnow(), make_bridges(), mech_dig(), mech_move_event(), mech_pickup(), mech_speed(), mech_thrash(), move_mech(), NewHexEntered(), possibly_blow_bridge(), sketch_tac_map(), terrain_speed(), and water_distance().

#define BUILDFLAG_CS   1

Definition at line 90 of file map.h.

#define BUILDFLAG_CSI   2

Definition at line 91 of file map.h.

#define BUILDFLAG_DSS   4

Definition at line 92 of file map.h.

#define BUILDFLAG_HID   16

Definition at line 94 of file map.h.

#define BUILDFLAG_NOB   8

Definition at line 93 of file map.h.

#define BUILDING   '@'

Definition at line 50 of file map.h.

Referenced by aero_land(), auto_radio_command_hide(), CheckForSmoke(), DoVehicleEngineHit(), GetTerrainName_base(), HandleVTOLCrit(), mech_dig(), NewHexEntered(), and TerrainColorChar().

#define BuildIsCS ( map   )     (map->buildflag & BUILDFLAG_CS)

Definition at line 97 of file map.h.

Referenced by hit_building().

#define BuildIsHidden ( map   )     (map->buildflag & (BUILDFLAG_DSS|BUILDFLAG_HID))

Definition at line 98 of file map.h.

Referenced by show_building_in_hex(), and steppable_base_check().

#define BuildIsInvis ( map   )     (map->buildflag & BUILDFLAG_HID)

Definition at line 100 of file map.h.

Referenced by show_building_in_hex(), and steppable_base_check().

#define BuildIsSafe ( map   )     (map->buildflag & BUILDFLAG_NOB)

Definition at line 99 of file map.h.

Referenced by mech_enter_event(), and mech_enterbase().

#define DEFAULT_MAP_HEIGHT   11

Definition at line 38 of file map.h.

Referenced by initialize_map_empty(), and map_load().

#define DEFAULT_MAP_WIDTH   21

Definition at line 37 of file map.h.

Referenced by initialize_map_empty(), and map_load().

#define FIRE   '&'

Definition at line 51 of file map.h.

Referenced by blast_hit_hexesf(), CalculateLOSFlag(), CheckForFire(), DestroyMech(), DS_BlastNearbyMechsAndTrees(), fiery_death(), fire_hex(), GetTerrainName_base(), growSnow(), map_addfire(), map_load(), map_savemap(), NewHexEntered(), TerrainColorChar(), and UpdateHeat().

#define get_buildflag (  )     atoi(silly_atr_get((a), A_BUILDFLAG))

Definition at line 199 of file map.h.

#define GRASSLAND   ' '

Definition at line 42 of file map.h.

Referenced by aero_land(), clear_hex(), determineDamageFromHit(), DoVehicleEngineHit(), fire_dissipation_event(), fun_btmapterr(), GetTerrainName_base(), HandleVTOLCrit(), HoverTankTileCost(), ImproperLZ(), map_load(), mech_ood_event(), mech_thrash(), MechTileCost(), NewHexEntered(), and TrackedTankTileCost().

#define HEAVY_FOREST   '"'

Definition at line 43 of file map.h.

Referenced by ai_crash(), auto_astar_generate_path(), auto_radio_command_hide(), auto_roam_generate_target_hex(), blast_hit_hexesf(), CalculateLOSFlag(), clear_hex(), determineDamageFromHit(), DS_BlastNearbyMechsAndTrees(), FindNormalBTH(), fire_hex(), GetTerrainName_base(), HoverTankTileCost(), mech_club(), mech_grabclub(), MechTileCost(), Missile_Hit(), NewHexEntered(), PhysicalAttack(), possibly_ignite(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), trace_slitelos(), and TrackedTankTileCost().

#define HIGHWATER   '?'

Definition at line 46 of file map.h.

Referenced by ai_crash(), auto_astar_generate_path(), CalculateLOSFlag(), GetTerrainName_base(), mech_ood_event(), mech_speed(), MechFalls(), NewHexEntered(), sketch_tac_map(), and TerrainColorChar().

#define ICE   '-'

Definition at line 58 of file map.h.

Referenced by CalculateLOSFlag(), CheckNavalHeight(), collision_check(), DropGetElevation(), DropSetElevation(), GetTerrainName_base(), growable_callback(), growSnow(), ice_growth(), ice_melt(), mech_jump(), mech_move_event(), mech_pickup(), mech_speed(), mech_stand(), meltable_callback(), move_mech(), NewHexEntered(), possible_mine_poof(), possibly_blow_ice(), terrain_speed(), TerrainColorChar(), and water_distance().

#define LIGHT_FOREST   '`'

Definition at line 44 of file map.h.

Referenced by auto_astar_generate_path(), auto_radio_command_hide(), auto_roam_generate_target_hex(), blast_hit_hexesf(), CalculateLOSFlag(), clear_hex(), determineDamageFromHit(), DS_BlastNearbyMechsAndTrees(), FindNormalBTH(), fire_hex(), GetTerrainName_base(), HoverTankTileCost(), map_load(), mech_club(), mech_grabclub(), MechTileCost(), Missile_Hit(), NewHexEntered(), PhysicalAttack(), possibly_ignite(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), trace_slitelos(), and TrackedTankTileCost().

#define MAP_DISPLAY_HEIGHT   14

Definition at line 40 of file map.h.

Referenced by map_view(), and mech_tacmap().

#define MAP_DISPLAY_WIDTH   21

Definition at line 39 of file map.h.

Referenced by map_view(), and mech_tacmap().

#define MAP_DOWN   1

Definition at line 28 of file map.h.

#define MAP_LEFT   3

Definition at line 30 of file map.h.

#define MAP_NAME_SIZE   30

Definition at line 35 of file map.h.

Referenced by map_load(), and map_savemap().

#define MAP_RIGHT   2

Definition at line 29 of file map.h.

#define MAP_UP   0

Definition at line 27 of file map.h.

#define MapBridgesCS ( map   )     ((map)->flags & MAPFLAG_BRIDGESCS)

Definition at line 110 of file map.h.

Referenced by possibly_blow_bridge().

#define MapCloudbase ( map   )     (map)->cloudbase

Definition at line 107 of file map.h.

#define MAPFLAG_BRIDGESCS   64

Definition at line 72 of file map.h.

#define MAPFLAG_DARK   32

Definition at line 71 of file map.h.

#define MAPFLAG_FIRES   8

Definition at line 68 of file map.h.

Referenced by map_load(), and map_savemap().

#define MAPFLAG_MAPO   1

Definition at line 65 of file map.h.

Referenced by add_mapobj(), CheckEdgeOfMap(), del_mapobj(), del_mapobjs(), del_mapobjst(), load_update1(), and save_maps_func().

#define MAPFLAG_NOBRIDGIFY   128

Definition at line 73 of file map.h.

#define MAPFLAG_NOFRIENDLYFIRE   256

Definition at line 74 of file map.h.

#define MAPFLAG_SPEC   2

Definition at line 66 of file map.h.

Referenced by map_setconditions().

#define MAPFLAG_UNDERGROUND   16

Definition at line 69 of file map.h.

Referenced by map_setconditions().

#define MAPFLAG_VACUUM   4

Definition at line 67 of file map.h.

Referenced by map_setconditions().

#define MapGravity   MapGravityMod

Definition at line 104 of file map.h.

Referenced by MechCargoMaxSpeed(), MechFalls(), and UpdateConditions().

#define MapGravityMod ( map   )     (map)->grav

Definition at line 103 of file map.h.

#define MapIsCS ( map   )     (map->buildflag & BUILDFLAG_CSI)

Definition at line 96 of file map.h.

Referenced by DamageMech(), and hit_building().

#define MapIsDark ( map   )     ((map)->flags & MAPFLAG_DARK)

Definition at line 109 of file map.h.

Referenced by mech_lrsmap(), mech_navigate(), mech_range(), and mech_tacmap().

#define MapIsUnderground ( map   )     ((map)->flags & MAPFLAG_UNDERGROUND)

Definition at line 108 of file map.h.

Referenced by aero_takeoff(), FireWeaponNumber(), mech_jump(), and reactor_explosion().

#define MapIsVacuum ( map   )     ((map)->flags & MAPFLAG_VACUUM)

Definition at line 105 of file map.h.

Referenced by UpdateConditions().

#define MapNoBridgify ( map   )     ((map)->flags & MAPFLAG_NOBRIDGIFY)

Definition at line 111 of file map.h.

#define MapNoFriendlyFire ( map   )     ((map)->flags & MAPFLAG_NOFRIENDLYFIRE)

Definition at line 112 of file map.h.

Referenced by DeathFromAbove(), FireWeaponNumber(), mech_charge(), and PhysicalAttack().

#define MapTemperature ( map   )     (map)->temp

Definition at line 106 of file map.h.

Referenced by setWeatherHeatEffects(), UpdateConditions(), and UpdateHeat().

#define MapUnderSpecialRules ( map   )     ((map)->flags & MAPFLAG_SPEC)

Definition at line 102 of file map.h.

Referenced by MechFalls(), UpdateConditions(), and UpdateHeat().

#define MAPX   1000

Definition at line 33 of file map.h.

Referenced by auto_astar_generate_path(), map_load(), map_savemap(), and map_setmapsize().

#define MAPY   1000

Definition at line 34 of file map.h.

Referenced by auto_astar_generate_path(), auto_create_astar_node(), map_load(), and map_setmapsize().

#define MAX_ELEV   9

Definition at line 41 of file map.h.

Referenced by map_addhex().

#define MAX_MECHS_PER_MAP   250

Definition at line 24 of file map.h.

Referenced by map_listmechs(), mech_contacts(), mech_Rsetmapindex(), nonrecursive_commlink(), show_lrs_map(), and showNetworkTargets().

#define MECHLOSBYTES_WATER   3

Definition at line 142 of file map.h.

#define MECHLOSBYTES_WOOD   4

Definition at line 136 of file map.h.

#define MECHLOSFLAG_BLOCK   0x8000

Definition at line 149 of file map.h.

Referenced by CalculateLOSFlag(), InLineOfSight(), InLineOfSight_NB(), mech_lites_target(), SearchLightInRange(), and update_LOSinfo().

#define MECHLOSFLAG_FIRE   0x2000

Definition at line 147 of file map.h.

Referenced by CalculateLOSFlag().

#define MECHLOSFLAG_MNTN   0x0010

Definition at line 130 of file map.h.

Referenced by CalculateLOSFlag(), and MechSeesOverMountain().

#define MECHLOSFLAG_PARTIAL   0x1000

Definition at line 145 of file map.h.

Referenced by AddTerrainMod(), and CalculateLOSFlag().

#define MECHLOSFLAG_SEEC2   0x0008

Definition at line 129 of file map.h.

Referenced by CalculateLOSFlag(), and Sensor_CanSee().

#define MECHLOSFLAG_SEEN   0x0001

Definition at line 126 of file map.h.

Referenced by auto_calc_target_score(), CalculateLOSFlag(), clear_mech_from_LOS(), InLineOfSight(), mech_plos_event(), remove_mech_from_map(), and Sensor_DoWeSeeNow().

#define MECHLOSFLAG_SEESP   0x0002

Definition at line 127 of file map.h.

Referenced by InLineOfSight(), mech_contacts(), Sensor_DoWeSeeNow(), Sensor_ToHitBonus(), showNetworkTargets(), and update_LOSinfo().

#define MECHLOSFLAG_SEESS   0x0004

Definition at line 128 of file map.h.

Referenced by InLineOfSight(), mech_contacts(), Sensor_DoWeSeeNow(), Sensor_ToHitBonus(), showNetworkTargets(), and update_LOSinfo().

#define MECHLOSFLAG_SMOKE   0x4000

Definition at line 148 of file map.h.

Referenced by CalculateLOSFlag().

#define MECHLOSFLAG_WATER   0x0200

Definition at line 139 of file map.h.

Referenced by CalculateLOSFlag(), and MechSeesThroughWater().

#define MECHLOSFLAG_WATER2   0x0400

Definition at line 140 of file map.h.

#define MECHLOSFLAG_WATER3   0x0800

Definition at line 141 of file map.h.

#define MECHLOSFLAG_WOOD   0x0020

Definition at line 132 of file map.h.

Referenced by CalculateLOSFlag(), and MechSeesThroughWoods().

#define MECHLOSFLAG_WOOD2   0x0040

Definition at line 133 of file map.h.

#define MECHLOSFLAG_WOOD3   0x0080

Definition at line 134 of file map.h.

#define MECHLOSFLAG_WOOD4   0x0100

Definition at line 135 of file map.h.

#define MECHLOSMAX_WATER   8

Definition at line 143 of file map.h.

Referenced by CalculateLOSFlag().

#define MECHLOSMAX_WOOD   16

Definition at line 137 of file map.h.

Referenced by CalculateLOSFlag().

#define MECHMAPFLAG_MOVED   1

Definition at line 124 of file map.h.

#define MOUNTAINS   '^'

Definition at line 48 of file map.h.

Referenced by auto_astar_generate_path(), auto_radio_command_hide(), CalculateLOSFlag(), GetTerrainName_base(), HoverTankTileCost(), MechTileCost(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), and TrackedTankTileCost().

#define NAVIGATE_LINES   13

Definition at line 191 of file map.h.

Referenced by mech_navigate().

#define NUM_MAP_LINKS   4

Definition at line 36 of file map.h.

#define NUM_MAPOBJTYPES   10

Definition at line 88 of file map.h.

Referenced by del_mapobjs(), find_mapobj(), fun_btlistblz(), list_mapobjs(), load_mapobjs(), map_delobj(), newfreemap(), obj_size(), and save_mapobjs().

#define ROAD   '#'

Definition at line 49 of file map.h.

Referenced by aero_land(), DoVehicleEngineHit(), GetTerrainName_base(), HandleVTOLCrit(), ImproperLZ(), make_bridges(), mech_dig(), mech_ood_event(), mech_thrash(), NewHexEntered(), terrain_speed(), TerrainColorChar(), and water_distance().

#define ROUGH   '%'

Definition at line 47 of file map.h.

Referenced by auto_astar_generate_path(), auto_radio_command_hide(), clear_hex(), DS_BlastNearbyMechsAndTrees(), fire_dissipation_event(), GetTerrainName_base(), HoverTankTileCost(), MechTileCost(), NewHexEntered(), terrain_speed(), TerrainColorChar(), and TrackedTankTileCost().

#define set_buildcf ( a,
 )     silly_atr_set((a), A_BUILDCF, tprintf("%d %d", (b), (b)))

Definition at line 200 of file map.h.

#define set_buildflag ( a,
 )     silly_atr_set((a), A_BUILDFLAG, tprintf("%d", (b)))

Definition at line 198 of file map.h.

#define SMOKE   ':'

Definition at line 53 of file map.h.

Referenced by artillery_hit_hex(), CalculateLOSFlag(), CheckForSmoke(), GetTerrainName_base(), map_addsmoke(), map_load(), map_savemap(), meltSnowAndIce(), PhysicalAttack(), TerrainColorChar(), trace_slitelos(), and water_extinguish_inferno().

#define SNOW   '+'

Definition at line 57 of file map.h.

Referenced by terrain_speed(), and TerrainColorChar().

#define TFIRE   '>'

Definition at line 52 of file map.h.

Referenced by map_load(), and map_savemap().

#define TYPE_B_LZ   9

Definition at line 87 of file map.h.

Referenced by fun_bthexinblz(), fun_btlistblz(), is_blocked_lz(), and map_add_block().

#define TYPE_BITS   8

Definition at line 86 of file map.h.

Referenced by bit_size(), clear_hex_bits(), grab_us_an_array(), is_hangar_hex(), is_mine_hex(), list_mapobjs(), load_mapobjs(), map_save_bits(), map_setmapsize(), and save_mapobjs().

#define TYPE_BUILD   4

Definition at line 81 of file map.h.

Referenced by add_links(), find_entrance_by_target(), find_entrance_by_xy(), load_mapobjs(), and recursively_updatelinks().

#define TYPE_DEC   2

Definition at line 78 of file map.h.

#define TYPE_ENTRANCE   6

Definition at line 83 of file map.h.

Referenced by add_entrances(), find_entrance(), and recursively_updatelinks().

#define TYPE_FIRE   0

Definition at line 76 of file map.h.

Referenced by add_decoration(), blast_hit_hexesf(), CheckForFire(), DestroyMech(), DS_BlastNearbyMechsAndTrees(), fire_dissipation_event(), fire_hex(), litemark_map(), map_addfire(), and map_savemap().

#define TYPE_LAST_DEC   2

Definition at line 79 of file map.h.

Referenced by add_decoration(), del_mapobj(), and find_decorations().

#define TYPE_LEAVE   5

Definition at line 82 of file map.h.

Referenced by CheckEdgeOfMap(), Leave_Hangar(), and recursively_updatelinks().

#define TYPE_LINKED   7

Definition at line 85 of file map.h.

Referenced by map_linked(), and map_setlinked().

#define TYPE_MINE   3

Definition at line 80 of file map.h.

Referenced by add_mine(), explode_mines(), make_mine_explode(), map_add_mine(), map_delobj(), possible_mine_explosion(), possibly_remove_mines(), recalculate_minefields(), and show_mines_in_hex().

#define TYPE_SMOKE   1

Definition at line 77 of file map.h.

Referenced by add_decoration(), artillery_hit_hex(), CheckForSmoke(), map_addsmoke(), meltSnowAndIce(), smoke_dissipation_event(), and water_extinguish_inferno().

#define UNKNOWN_TERRAIN   '$'

Definition at line 60 of file map.h.

Referenced by get_lrshexstr(), sketch_tac_map(), and TerrainColorChar().

#define WALL   '='

Definition at line 54 of file map.h.

Referenced by CheckForSmoke(), GetTerrainName_base(), mech_dig(), and TerrainColorChar().

#define WATER   '~'

Definition at line 45 of file map.h.

Referenced by ai_crash(), ai_path_score(), auto_astar_generate_path(), auto_roam_generate_target_hex(), break_sub(), break_thru_ice(), CalculateLOSFlag(), CheckNavalHeight(), collision_check(), drop_thru_ice(), FindNormalBTH(), FindPilotingSkillName(), GetTerrainName_base(), growSnow(), HoverTankTileCost(), ice_growth(), ice_melt(), mech_dig(), mech_move_event(), mech_ood_event(), mech_speed(), MechTileCost(), NewHexEntered(), sketch_tac_map(), swim_except(), terrain_speed(), TerrainColorChar(), trace_maphexlos(), TrackedTankTileCost(), and water_distance().


Typedef Documentation

typedef struct mapobj_struct mapobj


Function Documentation

void map_update ( dbref  obj,
void *  data 
)

Definition at line 503 of file map.c.

00504 {
00505         MAP *map = ((MAP *) data);
00506         MECH *mech;
00507         char *tmps, changemsg[LBUF_SIZE] = "";
00508         int ma, ml, wind, wspeed, cloudbase = 200;
00509         int oldl, oldv, i, j;
00510         AUTO *au;
00511 
00512         /* Changed from % 25 to % 60. %60 never hit when muxevent_tick came here and was odd.
00513            % 25 should hit when its odd or even (25 75 125... when odd 50 100 150... when even */
00514 
00515         if(!(muxevent_tick % 25)) {
00516                 oldl = map->maplight;
00517                 oldv = map->mapvis;
00518                 if(!(tmps = silly_atr_get(obj, A_MAPVIS)) ||
00519                    sscanf(tmps, "%d %d %d %d %d %[^\n]", &ma, &ml, &wind,
00520                                   &wspeed, &cloudbase, changemsg) < 4) {
00521                         ma = 30;
00522                         ml = 2;
00523                         wind = 0;
00524                         wspeed = 0;
00525                         cloudbase = 200;
00526                 }
00527                 map->winddir = wind;
00528                 map->windspeed = wspeed;
00529                 map->mapvis = BOUNDED(0, ma, 60);
00530                 map->maxvis = BOUNDED(24, ma * 3, 60);
00531                 map->maplight = BOUNDED(0, ml, 2);
00532                 map->cloudbase = cloudbase;
00533                 if(ml != oldl || ma != oldv)
00534                         for(i = 0; i < map->first_free; i++) {
00535                                 if((j = map->mechsOnMap[i]) < 0)
00536                                         continue;
00537                                 if(!(mech = getMech(j)))
00538                                         continue;
00539                                 if(ml != oldl)
00540                                         sensor_light_availability_check(mech);
00541                                 if(strlen(changemsg) > 5)
00542                                         mech_notify(mech, MECHALL, changemsg);
00543                         }
00544         }
00545         update_LOSinfo(obj, map);
00546         /* Fire/Smoke are event-driven -> nothing related to them done here */
00547 }

void newfreemap ( dbref  key,
void **  data,
int  selector 
)

Definition at line 567 of file map.c.

00568 {
00569         MAP *new = *data;
00570         int i;
00571 
00572         switch (selector) {
00573         case SPECIAL_ALLOC:
00574                 initialize_map_empty(new, key);
00575                 /* allocate default map space */
00576                 for(i = 0; i < NUM_MAPOBJTYPES; i++)
00577                         new->mapobj[i] = NULL;
00578                 sprintf(new->mapname, "%s", "Default Map");
00579                 break;
00580         case SPECIAL_FREE:
00581                 del_mapobjs(new);
00582                 if(new->map) {
00583                         for(i = new->map_height - 1; i >= 0; i--)
00584                                 if(new->map[i])
00585                                         free((char *) (new->map[i]));
00586                         free((char *) (new->map));
00587                 }
00588                 break;
00589         }
00590 }


Generated on Mon May 28 04:25:34 2007 for BattletechMUX by  doxygen 1.4.7