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)
|
if(dish.growth >= 50)
|
||||||
var/list/effects[0]
|
var/list/effects[0]
|
||||||
for (var/datum/disease2/effectholder/e in dish.virus2.effects)
|
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
|
data["effects"] = effects
|
||||||
else
|
else
|
||||||
data["info"] = "Insufficient cell growth for gene splicing."
|
data["info"] = "Insufficient cell growth for gene splicing."
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export const DiseaseSplicer = (props) => {
|
|||||||
const DiseaseSplicerVirusDish = (props) => {
|
const DiseaseSplicerVirusDish = (props) => {
|
||||||
const { act, data } = useBackend<Data>();
|
const { act, data } = useBackend<Data>();
|
||||||
|
|
||||||
const { dish_inserted, effects, info, growth, affected_species } = data;
|
const { dish_inserted, effects = [], info, growth, affected_species } = data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section
|
<Section
|
||||||
@@ -81,13 +81,16 @@ const DiseaseSplicerVirusDish = (props) => {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Section title="Symptoms">
|
<Section title="Symptoms">
|
||||||
{(effects &&
|
{effects!.length > 0 ? (
|
||||||
effects.map((effect) => (
|
effects!.map((effect) => (
|
||||||
<Box color="label" key={effect.stage}>
|
<Box color="label" key={effect.stage}>
|
||||||
({effect.stage}) {effect.name}{' '}
|
({effect.stage}) {effect.name}{' '}
|
||||||
{effect.badness > 1 ? 'Dangerous!' : null}
|
{effect.badness > 1 ? 'Dangerous!' : null}
|
||||||
</Box>
|
</Box>
|
||||||
))) || <Box>No virus sample loaded.</Box>}
|
))
|
||||||
|
) : (
|
||||||
|
<Box>No virus sample loaded.</Box>
|
||||||
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
<Section title="Affected Species" color="label">
|
<Section title="Affected Species" color="label">
|
||||||
{!affected_species || !affected_species.length
|
{!affected_species || !affected_species.length
|
||||||
@@ -98,8 +101,8 @@ const DiseaseSplicerVirusDish = (props) => {
|
|||||||
<Box color="bad" mb={1}>
|
<Box color="bad" mb={1}>
|
||||||
<i>CAUTION: Reverse engineering will destroy the viral sample.</i>
|
<i>CAUTION: Reverse engineering will destroy the viral sample.</i>
|
||||||
</Box>
|
</Box>
|
||||||
{effects &&
|
{!!effects!.length &&
|
||||||
effects.map((e) => (
|
effects!.map((e) => (
|
||||||
<Button
|
<Button
|
||||||
key={e.stage}
|
key={e.stage}
|
||||||
icon="exchange-alt"
|
icon="exchange-alt"
|
||||||
|
|||||||
Reference in New Issue
Block a user