forked from shiptest-ss13/Shiptest
-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple runtime error fixes (shiptest-ss13#2720)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Basically just goes down the list for most frequent runtimes and tries to fix them one way or another. ## Why It's Good For The Game Runtime errors shouldn't happen ## Changelog :cl: fix: Headpikes actually work again fix: Reinforced floors now don't spawn metal when decompression is experienced /:cl: <!-- Both :cl:'s are required for the changelog to work! You can put your name to the right of the first :cl: if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. --> --------- Co-authored-by: Ghom <[email protected]> Co-authored-by: Ghommie <[email protected]> Co-authored-by: ShizCalev <[email protected]>
- Loading branch information
1 parent
bde6eda
commit 99679fd
Showing
44 changed files
with
362 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
///the area channel of the important_recursive_contents list, everything in here will be sent a signal when their last holding object changes areas | ||
#define RECURSIVE_CONTENTS_AREA_SENSITIVE "recursive_contents_area_sensitive" | ||
///the hearing channel of the important_recursive_contents list, everything in here will count as a hearing atom | ||
#define RECURSIVE_CONTENTS_HEARING_SENSITIVE "recursive_contents_hearing_sensitive" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Beauty element. It makes the indoor area the parent is in prettier or uglier depending on the beauty var value. | ||
* Clean and well decorated areas lead to positive moodlets for passerbies; | ||
* Shabbier, dirtier ones lead to negative moodlets EXCLUSIVE to characters with the snob quirk. | ||
*/ | ||
/datum/element/beauty | ||
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH | ||
id_arg_index = 2 | ||
var/beauty = 0 | ||
/** | ||
* Assoc list of atoms as keys and number of time the same element instance has been attached to them as assoc value. | ||
* So things don't get odd with same-valued yet dissimilar beauty modifiers being added to the same atom. | ||
*/ | ||
var/beauty_counter = list() | ||
|
||
/datum/element/beauty/Attach(datum/target, beauty) | ||
. = ..() | ||
if(!isatom(target) || isarea(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
|
||
src.beauty = beauty | ||
|
||
if(!beauty_counter[target] && ismovable(target)) | ||
var/atom/movable/mov_target = target | ||
mov_target.become_area_sensitive(BEAUTY_ELEMENT_TRAIT) | ||
RegisterSignal(mov_target, COMSIG_ENTER_AREA, PROC_REF(enter_area)) | ||
RegisterSignal(mov_target, COMSIG_EXIT_AREA, PROC_REF(exit_area)) | ||
|
||
beauty_counter[target]++ | ||
|
||
var/area/current_area = get_area(target) | ||
if(current_area && !current_area.outdoors) | ||
current_area.totalbeauty += beauty | ||
current_area.update_beauty() | ||
|
||
/datum/element/beauty/proc/enter_area(datum/source, area/new_area) | ||
SIGNAL_HANDLER | ||
|
||
if(new_area.outdoors) | ||
return | ||
new_area.totalbeauty += beauty * beauty_counter[source] | ||
new_area.update_beauty() | ||
|
||
/datum/element/beauty/proc/exit_area(datum/source, area/old_area) | ||
SIGNAL_HANDLER | ||
|
||
if(old_area.outdoors) | ||
return | ||
old_area.totalbeauty -= beauty * beauty_counter[source] | ||
old_area.update_beauty() | ||
|
||
/datum/element/beauty/Detach(datum/source) | ||
if(!beauty_counter[source]) | ||
return ..() | ||
var/area/current_area = get_area(source) | ||
if(QDELETED(source)) | ||
. = ..() | ||
UnregisterSignal(source, list(COMSIG_ENTER_AREA, COMSIG_EXIT_AREA)) | ||
if(current_area) | ||
exit_area(source, current_area) | ||
beauty_counter -= source | ||
var/atom/movable/movable_source = source | ||
if(istype(movable_source)) | ||
movable_source.lose_area_sensitivity(BEAUTY_ELEMENT_TRAIT) | ||
else //lower the 'counter' down by one, update the area, and call parent if it's reached zero. | ||
beauty_counter[source]-- | ||
if(current_area && !current_area.outdoors) | ||
current_area.totalbeauty -= beauty | ||
current_area.update_beauty() | ||
if(!beauty_counter[source]) | ||
. = ..() | ||
UnregisterSignal(source, list(COMSIG_ENTER_AREA, COMSIG_EXIT_AREA)) | ||
beauty_counter -= source | ||
var/atom/movable/movable_source = source | ||
if(istype(movable_source)) | ||
movable_source.lose_area_sensitivity(BEAUTY_ELEMENT_TRAIT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.