mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fixes manual runtimes without modifying the construction of every object
Loads configuration before map creation instead.
This reverts commit 37b14bae39.
This commit is contained in:
@@ -504,11 +504,6 @@
|
|||||||
if("python_path")
|
if("python_path")
|
||||||
if(value)
|
if(value)
|
||||||
config.python_path = value
|
config.python_path = value
|
||||||
else
|
|
||||||
if(world.system_type == UNIX)
|
|
||||||
config.python_path = "/usr/bin/env python2"
|
|
||||||
else //probably windows, if not this should work anyway
|
|
||||||
config.python_path = "python"
|
|
||||||
|
|
||||||
if("use_lib_nudge")
|
if("use_lib_nudge")
|
||||||
config.use_lib_nudge = 1
|
config.use_lib_nudge = 1
|
||||||
@@ -741,3 +736,11 @@
|
|||||||
runnable_modes[M] = probabilities[M.config_tag]
|
runnable_modes[M] = probabilities[M.config_tag]
|
||||||
//world << "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]"
|
//world << "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]"
|
||||||
return runnable_modes
|
return runnable_modes
|
||||||
|
|
||||||
|
/datum/configuration/proc/post_load()
|
||||||
|
//apply a default value to config.python_path, if needed
|
||||||
|
if (!config.python_path)
|
||||||
|
if(world.system_type == UNIX)
|
||||||
|
config.python_path = "/usr/bin/env python2"
|
||||||
|
else //probably windows, if not this should work anyway
|
||||||
|
config.python_path = "python"
|
||||||
|
|||||||
@@ -111,6 +111,8 @@
|
|||||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
|
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
|
||||||
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
|
||||||
update_icon()
|
update_icon()
|
||||||
|
if(ticker && ticker.current_state == 3)//if the game is running
|
||||||
|
src.initialize()
|
||||||
return
|
return
|
||||||
|
|
||||||
first_run()
|
first_run()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/*********************MANUALS (BOOKS)***********************/
|
/*********************MANUALS (BOOKS)***********************/
|
||||||
|
|
||||||
//Oh god what the fuck I am not good at computer
|
|
||||||
/obj/item/weapon/book/manual
|
/obj/item/weapon/book/manual
|
||||||
icon = 'icons/obj/library.dmi'
|
icon = 'icons/obj/library.dmi'
|
||||||
due_date = 0 // Game time in 1/10th seconds
|
due_date = 0 // Game time in 1/10th seconds
|
||||||
@@ -13,7 +12,7 @@
|
|||||||
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
|
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
|
||||||
title = "Station Repairs and Construction"
|
title = "Station Repairs and Construction"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/engineering_construction/initialize()
|
/obj/item/weapon/book/manual/engineering_construction/New()
|
||||||
..()
|
..()
|
||||||
dat = {"
|
dat = {"
|
||||||
|
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
|
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
|
||||||
title = "Particle Accelerator User's Guide"
|
title = "Particle Accelerator User's Guide"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/engineering_particle_accelerator/initialize()
|
/obj/item/weapon/book/manual/engineering_particle_accelerator/New()
|
||||||
..()
|
..()
|
||||||
dat = {"<html>
|
dat = {"<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -81,7 +80,7 @@
|
|||||||
author = "Waleed Asad"
|
author = "Waleed Asad"
|
||||||
title = "Supermatter Engine User's Guide"
|
title = "Supermatter Engine User's Guide"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/supermatter_engine/initialize()
|
/obj/item/weapon/book/manual/supermatter_engine/New()
|
||||||
..()
|
..()
|
||||||
dat = {"<html>
|
dat = {"<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -193,7 +192,7 @@
|
|||||||
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
|
author = "Engineering Encyclopedia" // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned
|
||||||
title = "Hacking"
|
title = "Hacking"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/engineering_hacking/initialize()
|
/obj/item/weapon/book/manual/engineering_hacking/New()
|
||||||
..()
|
..()
|
||||||
dat = {"
|
dat = {"
|
||||||
|
|
||||||
@@ -750,7 +749,7 @@
|
|||||||
author = "NanoTrasen"
|
author = "NanoTrasen"
|
||||||
title = "Corporate Regulations"
|
title = "Corporate Regulations"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/security_space_law/initialize()
|
/obj/item/weapon/book/manual/security_space_law/New()
|
||||||
..()
|
..()
|
||||||
dat = {"
|
dat = {"
|
||||||
|
|
||||||
@@ -774,7 +773,7 @@
|
|||||||
author = "NanoTrasen Medicine Department"
|
author = "NanoTrasen Medicine Department"
|
||||||
title = "NT Medical Diagnostics Manual"
|
title = "NT Medical Diagnostics Manual"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/medical_diagnostics_manual/initialize()
|
/obj/item/weapon/book/manual/medical_diagnostics_manual/New()
|
||||||
..()
|
..()
|
||||||
dat = {"<html>
|
dat = {"<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -821,7 +820,7 @@
|
|||||||
author = "Engineering Encyclopedia"
|
author = "Engineering Encyclopedia"
|
||||||
title = "Engineering Textbook"
|
title = "Engineering Textbook"
|
||||||
|
|
||||||
/obj/item/weapon/book/manual/engineering_guide/initialize()
|
/obj/item/weapon/book/manual/engineering_guide/New()
|
||||||
..()
|
..()
|
||||||
dat = {"
|
dat = {"
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,6 @@
|
|||||||
var/damtype = "brute"
|
var/damtype = "brute"
|
||||||
var/force = 0
|
var/force = 0
|
||||||
|
|
||||||
/obj/New()
|
|
||||||
..()
|
|
||||||
// If the game is already underway initialize will no longer be called for us
|
|
||||||
if(ticker && ticker.current_state == GAME_STATE_PLAYING)
|
|
||||||
initialize()
|
|
||||||
|
|
||||||
/obj/Topic(href, href_list, var/nowindow = 0)
|
/obj/Topic(href, href_list, var/nowindow = 0)
|
||||||
// Calling Topic without a corresponding window open causes runtime errors
|
// Calling Topic without a corresponding window open causes runtime errors
|
||||||
if(nowindow)
|
if(nowindow)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ var/global/datum/global_init/init = new ()
|
|||||||
/datum/global_init/New()
|
/datum/global_init/New()
|
||||||
|
|
||||||
makeDatumRefLists()
|
makeDatumRefLists()
|
||||||
|
load_configuration()
|
||||||
|
|
||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ var/global/datum/global_init/init = new ()
|
|||||||
if(byond_version < RECOMMENDED_VERSION)
|
if(byond_version < RECOMMENDED_VERSION)
|
||||||
world.log << "Your server's byond version does not meet the recommended requirements for this server. Please update BYOND"
|
world.log << "Your server's byond version does not meet the recommended requirements for this server. Please update BYOND"
|
||||||
|
|
||||||
load_configuration()
|
config.post_load()
|
||||||
|
|
||||||
if(config && config.server_name != null && config.server_suffix && world.port > 0)
|
if(config && config.server_name != null && config.server_suffix && world.port > 0)
|
||||||
// dumb and hardcoded but I don't care~
|
// dumb and hardcoded but I don't care~
|
||||||
@@ -259,7 +260,7 @@ var/world_topic_spam_protect_time = world.timeofday
|
|||||||
join_motd = file2text("config/motd.txt")
|
join_motd = file2text("config/motd.txt")
|
||||||
|
|
||||||
|
|
||||||
/world/proc/load_configuration()
|
/proc/load_configuration()
|
||||||
config = new /datum/configuration()
|
config = new /datum/configuration()
|
||||||
config.load("config/config.txt")
|
config.load("config/config.txt")
|
||||||
config.load("config/game_options.txt","game_options")
|
config.load("config/game_options.txt","game_options")
|
||||||
|
|||||||
Reference in New Issue
Block a user