mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
[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:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user