forked from Mirrors/openclonk
Fixed a runtime error for melting ice
parent
994f45f521
commit
2686cfd6f0
|
@ -8,27 +8,30 @@ protected func Hit()
|
|||
protected func Construction()
|
||||
{
|
||||
var graphic = Random(5);
|
||||
if(graphic)
|
||||
SetGraphics(Format("%d",graphic));
|
||||
if (graphic)
|
||||
SetGraphics(Format("%d", graphic));
|
||||
AddTimer("Check", 30);
|
||||
}
|
||||
|
||||
protected func Check()
|
||||
{
|
||||
if(GetTemperature() > 0) Melt();
|
||||
if(GetTemperature() <= 0 && GetMaterial()==Material("Water") && GetCon()<100) Freeze();
|
||||
if (GetTemperature() <= 0 && GetMaterial() == Material("Water") && GetCon() < 100)
|
||||
Freeze();
|
||||
// Don't do anything af
|
||||
if (GetTemperature() > 0)
|
||||
Melt();
|
||||
}
|
||||
|
||||
private func Melt()
|
||||
{
|
||||
CastPXS("Water",2,0);
|
||||
CastPXS("Water", 2, 0);
|
||||
DoCon(-1);
|
||||
}
|
||||
|
||||
private func Freeze()
|
||||
{
|
||||
ExtractMaterialAmount(0, 0, Material("Water"), 2);
|
||||
DoCon(1);
|
||||
ExtractMaterialAmount(0,0,Material("Water"),2);
|
||||
}
|
||||
|
||||
local Collectible = 1;
|
||||
|
|
Loading…
Reference in New Issue