From 28e552841754a7547c7240118938243034832e04 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 3 Jul 2009 13:01:52 +0000 Subject: [PATCH] safety check when copying sectors; a suggestion to bypass a strange bug git-svn-id: https://svn.eduke32.com/eduke32@1449 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 94 ++++++++++++++++++------------ polymer/eduke32/build/src/config.c | 6 +- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 8ccad8edc..5cd433090 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -3958,55 +3958,73 @@ SKIP: } if (keystatus[0xd2] || keystatus[0x17]) //InsertPoint - { + { if (highlightsectorcnt >= 0) { - newnumsectors = numsectors; - newnumwalls = numwalls; + int32_t newwalls = 0; for (i=0; i= 0) - checksectorpointer(wall[j].nextwall,wall[j].nextsector); - checksectorpointer((int16_t)j,highlightsector[i]); + copysector(highlightsector[i],newnumsectors,newnumwalls,1); + newnumsectors++; + newnumwalls += sector[highlightsector[i]].wallnum; } - highlightsector[i] = numsectors+i; + + for (i=0; i= 0) + checksectorpointer(wall[j].nextwall,wall[j].nextsector); + checksectorpointer((int16_t)j,highlightsector[i]); + } + highlightsector[i] = numsectors+i; + } + numsectors = newnumsectors; + numwalls = newnumwalls; + + newnumwalls = -1; + newnumsectors = -1; + + updatenumsprites(); + printmessage16("Sectors duplicated and stamped."); + asksave = 1; + } + else + { + printmessage16("Copying sectors would exceed sector or wall limit."); } - numsectors = newnumsectors; - numwalls = newnumwalls; - - newnumwalls = -1; - newnumsectors = -1; - - updatenumsprites(); - printmessage16("Sectors duplicated and stamped."); - asksave = 1; } else if (highlightcnt >= 0) { - for (i=0; i= 0) { diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index e4c6eadc2..8226ac964 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -441,8 +441,10 @@ int32_t writesetup(const char *fn) #endif // "; Console key scancode, in hex\n" "keyconsole = %X\n" - "; example: make 'Q' function as CapsLock and 'N' as AltGr:\n" - "; remap = 10-3A,31-B8\n" + "; example: make 'Q' function as CapsLock, KP. as AltGr\n" + "; and KP0 as KP5 (counters inability to pan using Shift-KP5-KP8/2\n" + "; in 3D mode)\n" + "; remap = 10-3A,52-4C,53-B8\n" "remap = ", forcesetup, fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame,