From 1266307070b6fc8d234e90744c436253399d9f24 Mon Sep 17 00:00:00 2001 From: mniip Date: Thu, 30 Jan 2014 22:55:55 +0400 Subject: [PATCH] stop neut from dragging particles inside energy walls, fixes jacob#18 --- src/simulation/Simulation.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index cee906873..01d6c5c57 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2345,6 +2345,8 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny) if (s && !(elements[s&0xFF].Properties&PROP_NEUTPENETRATE)) return 1; // if the element currently underneath neutron isn't NEUTPENETRATE, don't move anything except the neutron // if nothing is currently underneath neutron, only move target particle + if(bmap[y/CELL][x/CELL] == WL_ALLOWENERGY) + return 1; // do not drag target particle into an energy only wall if (s) { pmap[ny][nx] = (s&~(0xFF))|parts[s>>8].type;