[MIRROR] Fixed RAM component retaining its type after the input port is cleared (#6328)

* Fixed RAM component retaining its type after the input port is cleared (#59592)

Allows people to input types, such as strings, entities or numbers with the Stored Value type retaining its last input type, which can result in bugs.

* Fixed RAM component retaining its type after the input port is cleared

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-06-15 21:36:18 +02:00
committed by GitHub
parent 9fe21539c9
commit 6f1af6c9be
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -135,6 +135,9 @@
if(connected_port.datatype != output_port.datatype)
output_port.set_datatype(connected_port.datatype)
return TRUE
else
output_port.set_datatype(output_port.default_datatype)
return TRUE
return FALSE
+4
View File
@@ -15,6 +15,9 @@
/// The port type. Ports can only connect to each other if the type matches
var/datatype
/// The default port type. Stores the original datatype of the port set on Initialize.
var/default_datatype
/// The port color. If unset, appears as blue.
var/color
@@ -28,6 +31,7 @@
src.connected_component = to_connect
src.name = name
src.datatype = datatype
src.default_datatype = datatype
src.color = datatype_to_color()