Mapster32: make sprite duplication examples in m32script_ex.map work again.

- Work around a sequencing issue (assignment of searchstat) in
  M32_DrawRoomsAndMasks()
- When having sprites highlighted and changing shade, since r1943 change
  every highlighted sprite's shade if one of them is aimed at. With this
  revision, if SHIFT is pressed while doing that, only change the aimed at
  sprite's shade
- a.m32: Use 'break' from a state instead of 'return'. The former may be
  "sticky" in a way that is not intended. Needs to be debugged later.
- Update instructions in m32script_ex.map

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4880 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-01-06 19:56:41 +00:00
parent a9cb38dbcf
commit b5bb86b8e2
6 changed files with 19 additions and 4 deletions

View file

@ -489,14 +489,28 @@ void M32_ResetFakeRORTiles(void)
void M32_DrawRoomsAndMasks(void) void M32_DrawRoomsAndMasks(void)
{ {
static int srchwall = -1;
VM_OnEvent(EVENT_PREDRAW3DSCREEN, -1); VM_OnEvent(EVENT_PREDRAW3DSCREEN, -1);
yax_preparedrawrooms(); yax_preparedrawrooms();
drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum); drawrooms(pos.x,pos.y,pos.z,ang,horiz,cursectnum);
yax_drawrooms(CallExtAnalyzeSprites, cursectnum, 0, 0); yax_drawrooms(CallExtAnalyzeSprites, cursectnum, 0, 0);
const int osearchwall=searchwall, osearchstat=searchstat;
if (srchwall >= 0)
{
// a.m32 states 'tduprot' and 'tduplin' need searchstat to check for
// whether we've hit a sprite, but these would be only set after the
// drawmasks(). Hence this hackish workaround.
searchstat = 3;
searchwall = srchwall;
}
CallExtAnalyzeSprites(0,0,0,0); CallExtAnalyzeSprites(0,0,0,0);
searchwall = osearchwall, searchstat=osearchstat;
drawmasks(); drawmasks();
srchwall = (searchstat == 3) ? searchwall : -1;
M32_ResetFakeRORTiles(); M32_ResetFakeRORTiles();
#ifdef POLYMER #ifdef POLYMER

View file

@ -1121,7 +1121,7 @@ defstate respawnpreview
ife showrespawn_always 0 ife showrespawn_always 0
{ {
ifaimingsprite ife sprite[searchwall].picnum RESPAWN nullop ifaimingsprite ife sprite[searchwall].picnum RESPAWN nullop
else break else return
} }
set onumtspr spritesortcnt set onumtspr spritesortcnt

View file

@ -5021,7 +5021,7 @@ static void Keys3d(void)
{ {
if (ASSERT_AIMING) if (ASSERT_AIMING)
{ {
if (AIMING_AT_SPRITE && (show2dsprite[searchwall>>3]&(1<<(searchwall&7)))) if (!eitherSHIFT && AIMING_AT_SPRITE && (show2dsprite[searchwall>>3]&(1<<(searchwall&7))))
{ {
for (i=0; i<highlightcnt; i++) for (i=0; i<highlightcnt; i++)
if (highlight[i]&16384) if (highlight[i]&16384)

View file

@ -33,7 +33,7 @@ correctness in a broad sense, which encompasses multiple issues.
* On the run-time side, most checking is done by Lunatic. For example, indexing * On the run-time side, most checking is done by Lunatic. For example, indexing
actor gamevars with out-of-bounds values produces an error that gets actor gamevars with out-of-bounds values produces an error that gets
permanently displayed on the screen. Like with Lua code, the permanently displayed on the screen. Like with Lua code, the
link:lunatic.html/#error[error] entry in the log then contains a traceback link:lunatic.html#error[error] entry in the log then contains a traceback
annotated with line numbers, making it possible for the CON coder to pinpoint annotated with line numbers, making it possible for the CON coder to pinpoint
its location and context. its location and context.
@ -313,7 +313,7 @@ Behavior on error
As LunaCON is implemented by translating all given CON code to a Lunatic As LunaCON is implemented by translating all given CON code to a Lunatic
module, it is the Lunatic runtime that checks for proper use of its services at module, it is the Lunatic runtime that checks for proper use of its services at
execution time and takes care of error handling and reporting. In Lua, an error execution time and takes care of error handling and reporting. In Lua, an error
link:lunatic.html/#nlcf[transfers control] to the end of the innermost link:lunatic.html#nlcf[transfers control] to the end of the innermost
``protected'' call of a Lua chunk. ``protected'' call of a Lua chunk.
This is in contrast to C-CON, which for some errors would print a message to This is in contrast to C-CON, which for some errors would print a message to

View file

@ -366,6 +366,7 @@ skip_check:
return 1; return 1;
case CON_BREAK: case CON_BREAK:
vm.flags |= VMFLAG_BREAK; vm.flags |= VMFLAG_BREAK;
// XXX: may not be cleared subsequently?
case CON_ENDS: case CON_ENDS:
return 1; return 1;