ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/map.C
(Generate patch)

Comparing deliantra/server/common/map.C (file contents):
Revision 1.203 by root, Sat Apr 23 04:56:46 2011 UTC vs.
Revision 1.204 by root, Wed May 4 07:36:40 2011 UTC

361} 361}
362 362
363void 363void
364maptile::activate () 364maptile::activate ()
365{ 365{
366 if (spaces) 366 if (in_memory != MAP_INACTIVE)
367 return;
368
367 for (mapspace *ms = spaces + size (); ms-- > spaces; ) 369 for (mapspace *ms = spaces + size (); ms-- > spaces; )
368 for (object *op = ms->bot; op; op = op->above) 370 for (object *op = ms->bot; op; op = op->above)
369 op->activate_recursive (); 371 op->activate_recursive ();
372
373 in_memory = MAP_ACTIVE;
370} 374}
371 375
372void 376void
373maptile::deactivate () 377maptile::deactivate ()
374{ 378{
375 if (spaces) 379 if (in_memory != MAP_ACTIVE)
380 return;
381
376 for (mapspace *ms = spaces + size (); ms-- > spaces; ) 382 for (mapspace *ms = spaces + size (); ms-- > spaces; )
377 for (object *op = ms->bot; op; op = op->above) 383 for (object *op = ms->bot; op; op = op->above)
378 op->deactivate_recursive (); 384 op->deactivate_recursive ();
385
386 in_memory = MAP_INACTIVE;
379} 387}
380 388
381bool 389bool
382maptile::_save_objects (object_freezer &f, int flags) 390maptile::_save_objects (object_freezer &f, int flags)
383{ 391{
1198maptile::tile_available (int dir, bool load) 1206maptile::tile_available (int dir, bool load)
1199{ 1207{
1200 if (tile_path[dir]) 1208 if (tile_path[dir])
1201 { 1209 {
1202 // map is there and we don't need to load it OR it's loaded => return what we have 1210 // map is there and we don't need to load it OR it's loaded => return what we have
1203 if (tile_map[dir] && (!load || tile_map[dir]->in_memory == MAP_ACTIVE)) 1211 if (tile_map[dir] && (!load || tile_map[dir]->linkable ()))
1204 return tile_map[dir]; 1212 return tile_map[dir];
1205 1213
1206 // well, try to locate it then, if possible - maybe it's there already 1214 // well, try to locate it then, if possible - maybe it's there already
1207 if ((tile_map[dir] = find_async (tile_path[dir], this, load))) 1215 if ((tile_map[dir] = find_async (tile_path[dir], this, load)))
1208 return tile_map[dir]; 1216 return tile_map[dir];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines