From 83fa555239450d2e89e68fcd869f612a17893be4 Mon Sep 17 00:00:00 2001 From: Bukz Date: Sun, 20 May 2012 17:06:02 +0000 Subject: [PATCH] Texture bug on map saves fix (Thanks to Felix-The-Ghost --- please test) and updated win bins. git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6800 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/worldio.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index 2cf8c6d2..5929e374 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -64,7 +64,7 @@ void topt(sqr *s, bool &wf, bool &uf, int &wt, int &ut) o[1] = SWS(s,0,1,sfactor); o[2] = SWS(s,1,0,sfactor); o[3] = SWS(s,-1,0,sfactor); - wf = true; + wf = true; uf = true; if(SOLID(s)) { @@ -74,14 +74,29 @@ void topt(sqr *s, bool &wf, bool &uf, int &wt, int &ut) wt = s->wtex; ut = s->utex; return; - } + } } else { loopi(4) if(!SOLID(o[i])) { - if(o[i]->floorfloor) { wt = s->wtex; wf = false; } - if(o[i]->ceil>s->ceil) { ut = s->utex; uf = false; } + //don't corrupt non-matching cube types + if (o[i]->type != s->type) + { + wf = false; + uf = false; + wt = s->wtex; + ut = s->utex; + return; + } + + //wall + if(o[i]->floor < s->floor) + { wt = s->wtex; wf = false; } + + //upper wall + if(o[i]->ceil > s->ceil) + { ut = s->utex; uf = false; } } } }