mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] fix splicer (#8730)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
if(dish.growth >= 50)
|
||||
var/list/effects[0]
|
||||
for (var/datum/disease2/effectholder/e in dish.virus2.effects)
|
||||
effects.Add(list(list("name" = (dish.analysed ? e.effect.name : "Unknown"), "stage" = (e.stage), "reference" = "\ref[e]"), "badness" = e.effect.badness))
|
||||
effects.Add(list(list("name" = (dish.analysed ? e.effect.name : "Unknown"), "stage" = (e.stage), "reference" = "\ref[e]", "badness" = e.effect.badness)))
|
||||
data["effects"] = effects
|
||||
else
|
||||
data["info"] = "Insufficient cell growth for gene splicing."
|
||||
|
||||
@@ -45,7 +45,7 @@ export const DiseaseSplicer = (props) => {
|
||||
const DiseaseSplicerVirusDish = (props) => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
|
||||
const { dish_inserted, effects, info, growth, affected_species } = data;
|
||||
const { dish_inserted, effects = [], info, growth, affected_species } = data;
|
||||
|
||||
return (
|
||||
<Section
|
||||
@@ -81,13 +81,16 @@ const DiseaseSplicerVirusDish = (props) => {
|
||||
) : (
|
||||
<>
|
||||
<Section title="Symptoms">
|
||||
{(effects &&
|
||||
effects.map((effect) => (
|
||||
{effects!.length > 0 ? (
|
||||
effects!.map((effect) => (
|
||||
<Box color="label" key={effect.stage}>
|
||||
({effect.stage}) {effect.name}{' '}
|
||||
{effect.badness > 1 ? 'Dangerous!' : null}
|
||||
</Box>
|
||||
))) || <Box>No virus sample loaded.</Box>}
|
||||
))
|
||||
) : (
|
||||
<Box>No virus sample loaded.</Box>
|
||||
)}
|
||||
</Section>
|
||||
<Section title="Affected Species" color="label">
|
||||
{!affected_species || !affected_species.length
|
||||
@@ -98,8 +101,8 @@ const DiseaseSplicerVirusDish = (props) => {
|
||||
<Box color="bad" mb={1}>
|
||||
<i>CAUTION: Reverse engineering will destroy the viral sample.</i>
|
||||
</Box>
|
||||
{effects &&
|
||||
effects.map((e) => (
|
||||
{!!effects!.length &&
|
||||
effects!.map((e) => (
|
||||
<Button
|
||||
key={e.stage}
|
||||
icon="exchange-alt"
|
||||
|
||||
Reference in New Issue
Block a user