From ed9710c33d18e51a7136d5e29498a68af9c15e86 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sat, 4 May 2013 14:44:16 +0100 Subject: [PATCH] Tungsten breaks under pressure changes --- src/simulation/elements/TUGN.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/simulation/elements/TUGN.cpp b/src/simulation/elements/TUGN.cpp index e77047863..2c2c2369c 100644 --- a/src/simulation/elements/TUGN.cpp +++ b/src/simulation/elements/TUGN.cpp @@ -96,6 +96,12 @@ int Element_TUGN::update(UPDATE_FUNC_ARGS) parts[i].vy += (rand()%100)-50; return 1; } + parts[i].pavg[0] = parts[i].pavg[1]; + parts[i].pavg[1] = sim->pv[y/CELL][x/CELL]; + if (parts[i].pavg[1]-parts[i].pavg[0] > 0.50f || parts[i].pavg[1]-parts[i].pavg[0] < -0.50f) + { + sim->part_change_type(i,x,y,PT_BRMT); + } return 0; }