// LP: added whether a savegame is being restored (skip Pfhortran init if that's the case)
bool entering_map(bool restoring_saved)
{
	bool success= true;

	/* if any active monsters think they have paths, we'll make them reconsider */
	initialize_monsters_for_new_level();

	/* and since no monsters have paths, we should make sure no paths think they have monsters */
	reset_paths();
	
	/* mark our shape collections for loading and load them */
	mark_environment_collections(static_world->environment_code, true);
	mark_all_monster_collections(true);
	mark_player_collections(true);
	mark_map_collections(true);

	MarkLuaCollections(true);
	MarkLuaHUDCollections(true);

#ifdef SDL
	load_collections(true, get_screen_mode()->acceleration != _no_acceleration);
#else
	load_collections(true, true);
#endif

	load_all_monster_sounds();
	load_all_game_sounds(static_world->environment_code);

#if !defined(DISABLE_NETWORKING)
	/* tell the keyboard controller to start recording keyboard flags */
	if (game_is_networked) success= NetSync(); /* make sure everybody is ready */
#endif // !defined(DISABLE_NETWORKING)

	/* make sure nobodyÕs holding a weapon illegal in the new environment */
	check_player_weapons_for_environment_change();

#if !defined(DISABLE_NETWORKING)
	if (dynamic_world->player_count>1 && !restoring_saved) initialize_net_game();
#endif // !defined(DISABLE_NETWORKING)
	randomize_scenery_shapes();

//	reset_action_queues(); //¦¦
//	sync_heartbeat_count();
//	set_keyboard_controller_status(true);

	L_Call_Init(restoring_saved);

#if !defined(DISABLE_NETWORKING)
	NetSetChatCallbacks(InGameChatCallbacks::instance());
#endif // !defined(DISABLE_NETWORKING)

	// Zero out fades *AND* any inadvertant fades from script start...
	stop_fade();
	set_fade_effect(NONE);
	
	if (!success) leaving_map();

	return success;
}
void
PlayerImage::objectCreated() {
    if(sNumOutstandingObjects == 0) {
        mark_collection(get_player_shape_definitions()->collection, true);
        load_collections(false, false);
        // XXX (ZZZ) ugly hack, making sure we don't load multiple times.
//        sNumOutstandingObjects++;
    }
    
    sNumOutstandingObjects++;
}