Merge pull request #8337 from PsiOmegaDelta/Map

Fixes #8334.
This commit is contained in:
Zuhayr
2015-03-03 11:58:35 +10:30
3 changed files with 58 additions and 58 deletions

View File

@@ -1002,7 +1002,7 @@ About the new airlock wires panel:
if(operating || welded || locked) if(operating || welded || locked)
return return
if(!forced) if(!forced)
//despite the name, this wire is for general door control. //despite the name, this wire is for general door control.
//Bolts are already covered by the check for locked, above //Bolts are already covered by the check for locked, above
if( !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_OPEN_DOOR) ) if( !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_OPEN_DOOR) )
return return
@@ -1076,7 +1076,7 @@ About the new airlock wires panel:
emitter_resistance *= 3 emitter_resistance *= 3
//if assembly is given, create the new door from the assembly //if assembly is given, create the new door from the assembly
if (assembly) if (assembly && istype(assembly))
assembly_type = assembly.type assembly_type = assembly.type
electronics = assembly.electronics electronics = assembly.electronics

View File

@@ -1,54 +1,55 @@
proc/createRandomZlevel() proc/createRandomZlevel()
if(awaydestinations.len) //crude, but it saves another var! if(awaydestinations.len) //crude, but it saves another var!
return return
var/list/potentialRandomZlevels = list() var/list/potentialRandomZlevels = list()
world << "\red \b Searching for away missions..." world << "\red \b Searching for away missions..."
var/list/Lines = file2list("maps/RandomZLevels/fileList.txt") var/list/Lines = file2list("maps/RandomZLevels/fileList.txt")
if(!Lines.len) return if(!Lines.len) return
for (var/t in Lines) for (var/t in Lines)
if (!t) if (!t)
continue continue
t = trim(t) t = trim(t)
if (length(t) == 0) if (length(t) == 0)
continue continue
else if (copytext(t, 1, 2) == "#") else if (copytext(t, 1, 2) == "#")
continue continue
var/pos = findtext(t, " ") var/pos = findtext(t, " ")
var/name = null var/name = null
// var/value = null // var/value = null
if (pos) if (pos)
// No, don't do lowertext here, that breaks paths on linux // No, don't do lowertext here, that breaks paths on linux
name = copytext(t, 1, pos) name = copytext(t, 1, pos)
// value = copytext(t, pos + 1) // value = copytext(t, pos + 1)
else else
// No, don't do lowertext here, that breaks paths on linux // No, don't do lowertext here, that breaks paths on linux
name = t name = t
if (!name) if (!name)
continue continue
potentialRandomZlevels.Add(name) potentialRandomZlevels.Add(name)
if(potentialRandomZlevels.len) if(potentialRandomZlevels.len)
world << "\red \b Loading away mission..." world << "\red \b Loading away mission..."
var/map = pick(potentialRandomZlevels) var/map = pick(potentialRandomZlevels)
var/file = file(map) var/file = file(map)
if(isfile(file)) if(isfile(file))
maploader.load_map(file, load_speed = 100) maploader.load_map(file)
world.log << "away mission loaded: [map]"
for(var/obj/effect/landmark/L in landmarks_list)
if (L.name != "awaystart") for(var/obj/effect/landmark/L in landmarks_list)
continue if (L.name != "awaystart")
awaydestinations.Add(L) continue
awaydestinations.Add(L)
world << "\red \b Away mission loaded."
world << "\red \b Away mission loaded."
else
world << "\red \b No away missions found." else
return world << "\red \b No away missions found."
return

View File

@@ -53,10 +53,9 @@ dmm_suite{
*/ */
verb/load_map(var/dmm_file as file, var/z_offset as num, var/load_speed as num) verb/load_map(var/dmm_file as file, var/z_offset as num)
// dmm_file: A .dmm file to load (Required). // dmm_file: A .dmm file to load (Required).
// z_offset: A number representing the z-level on which to start loading the map (Optional). // z_offset: A number representing the z-level on which to start loading the map (Optional).
// load_speed: How many tiles should be loaded per second, defaults to no pause (Optional)
verb/write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num){ verb/write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num){
// t1: A turf representing one corner of a three dimensional grid (Required). // t1: A turf representing one corner of a three dimensional grid (Required).