Author Topic: Disable mapping by room  (Read 1769 times)

Offline hells

  • Acquaintance
  • *
  • Posts: 11
    • View Profile
Disable mapping by room
« on: March 17, 2012, 06:27:53 am »
I wanted to disable mapping in a few rooms that were covered in mist. I made a couple small changes to do this.

lib/events/describe.c

line 63:
Code: [Select]
#if MINIMAP
            if(this_object()->GetProperty("minimapping") && !env->GetProperty("disablemapping")){
                desc += simple_map(env)+"\n";
            }
#endif

line 87:
Code: [Select]
        if(i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM){
            desc = env->GetShort();
            if(this_object()->GetProperty("minimapping") && !env->GetProperty("disablemapping"))
                    desc += simple_map(env)+"\n";

This checks a property "disablemapping" to see if it is set to 1. If it is it will disable minimapping for each room it is set. The wizmapping is not affected.

secure/cmds/players/map.c

line 12:

Code: [Select]
    if(!creatorp(this_player()) && environment(this_player())->GetProperty("disablemapping")) {
        write("You are unable to see your map.");
    } else {
        ret = MAP_D->GetMap(environment(this_player()), i, 1);
        write(ret);
    }

This code will disable viewing maps if you are not a creator and display a message.

This isn't much but I figured it might be helpful if you want to disable viewing of maps for a specific area. Perhaps a one room building or similar since there would be not much value in mapping in those cases.
 
-Hells
« Last Edit: March 17, 2012, 06:30:37 am by hells »