mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Many bug fixes, QoL, and PDA notes port (now with sensible diffs) (#7588)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com> Co-authored-by: Nadyr <forlirnglacignis@gmail.com>
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
var/annihilate = FALSE // If true, all (movable) atoms at the location where the map is loaded will be deleted before the map is loaded in.
|
||||
var/fixed_orientation = FALSE // If true, the submap will not be rotated randomly when loaded.
|
||||
|
||||
var/cost = null /* The map generator has a set 'budget' it spends to place down different submaps. It will pick available submaps randomly until
|
||||
it runs out. The cost of a submap should roughly corrispond with several factors such as size, loot, difficulty, desired scarcity, etc.
|
||||
var/cost = null /* The map generator has a set 'budget' it spends to place down different submaps. It will pick available submaps randomly until
|
||||
it runs out. The cost of a submap should roughly corrispond with several factors such as size, loot, difficulty, desired scarcity, etc.
|
||||
Set to -1 to force the submap to always be made. */
|
||||
var/allow_duplicates = FALSE // If false, only one map template will be spawned by the game. Doesn't affect admins spawning then manually.
|
||||
var/discard_prob = 0 // If non-zero, there is a chance that the map seeding algorithm will skip this template when selecting potential templates to use.
|
||||
@@ -74,7 +74,7 @@
|
||||
A.power_change()
|
||||
|
||||
if(machinery_was_awake)
|
||||
SSmachines.wake() // Wake only if it was awake before we tried to suspended it.
|
||||
SSmachines.wake() // Wake only if it was awake before we tried to suspended it.
|
||||
SSshuttles.block_init_queue = prev_shuttle_queue_state
|
||||
SSshuttles.process_init_queues() // We will flush the queue unless there were other blockers, in which case they will do it.
|
||||
|
||||
@@ -214,6 +214,12 @@
|
||||
potential_submaps -= chosen_template
|
||||
continue
|
||||
|
||||
// Is single use template already placed
|
||||
if(!chosen_template.allow_duplicates && chosen_template.loaded)
|
||||
priority_submaps -= chosen_template
|
||||
potential_submaps -= chosen_template
|
||||
continue
|
||||
|
||||
// Did we already place down a very similar submap?
|
||||
if(chosen_template.template_group && (chosen_template.template_group in template_groups_used))
|
||||
priority_submaps -= chosen_template
|
||||
@@ -253,6 +259,13 @@
|
||||
|
||||
admin_notice("Submap \"[chosen_template.name]\" placed at ([T.x], [T.y], [T.z])\n", R_DEBUG)
|
||||
|
||||
if(specific_sanity < 0)
|
||||
// I have no idea how this function has a race condition for the sanity check, but forcing the inner check loop to end like this fixes it...
|
||||
// If a template doesn't allow duplicates, it tries to double place a template. this fixes that.
|
||||
break
|
||||
if(!chosen_template.allow_duplicates)
|
||||
specific_sanity = -1 // force end the placement loop
|
||||
|
||||
// Do loading here.
|
||||
chosen_template.load(T, centered = TRUE, orientation=orientation) // This is run before the main map's initialization routine, so that can initilize our submaps for us instead.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user