Package: freedink-engine
Version: 1.08.20120427-2
Severity: normal
Tags: patch

When hitting a monster on a full screen, spr[0].seq is filled with a non-zero
value. This makes dink hang the next time he triggers a warp on a type 2
sprite.

traceback with a watchpoint on spr[0].seq:

(gdb) run -g ~/dmods/4towers -w
Starting program:
/home/shevek/src/git/pydink/dink-source/freedink-1.08.20100420/src/freedink
-g ~/dmods/4towers -w
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
[New Thread 0xb6f5cb70 (LWP 4604)]
[New Thread 0xb2470b70 (LWP 4605)]
[Thread 0xb2470b70 (LWP 4605) exited]
[New Thread 0xb2470b70 (LWP 4606)]
....
(gdb) watch spr[0].seq
Hardware watchpoint 3: spr[0].seq
(gdb) c
Continuing.
[ERROR] [DinkC] boss-splitbug:34: out of var space, all 250 used
[ERROR] [DinkC] boss-splitbug:34:[var_equals]: unknown var &crap
[ERROR] [DinkC] boss-splitbug:34: out of var space, all 250 used
[ERROR] [DinkC] boss-splitbug:34:[var_equals]: unknown var &crap
Hardware watchpoint 3: spr[0].seq

Old value = 0
New value = 189
random_blood (mx=607, my=349, sprite=232) at dinkvar.c:3939
3939                    if (sprite > 0)
(gdb) bt
#0  random_blood (mx=607, my=349, sprite=232) at dinkvar.c:3939
#1  0x08074dfc in run_through_tag_list (h=1, strength=6) at freedink.c:3737
#2  0x0807890b in updateFrame () at update_frame.c:615
#3  0x0804bbcd in main (argc=4, argv=0xbffff2a4) at freedink.c:5027
(gdb) l
3934                    int crap2 = add_sprite(mx,my,5,myseq,1);
3935                    spr[crap2].speed = 0;
3936                    spr[crap2].base_walk = -1;
3937                    spr[crap2].nohit = 1;
3938                    spr[crap2].seq = myseq;
3939                    if (sprite > 0)
3940                            spr[crap2].que = spr[sprite].y+1;
3941    
3942            }
3943    

In other words, the solution is to let random_blood check if the sprite can be
created (that is, crap2 != 0), and if not, don't fill its members. I've
attached a patch.

Thanks,
Bas

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/2 CPU cores)
Locale: LANG=nl_NL.UTF-8, LC_CTYPE=nl_NL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages freedink-engine depends on:
ii  fonts-liberation [ttf-liberation]  1.07.2-5
ii  freedink-data                      1.08.20111016-1
ii  freepats                           20060219-1
ii  libc6                              2.13-35
ii  libfontconfig1                     2.9.0-7
ii  libsdl-gfx1.2-4                    2.0.23-2
ii  libsdl-image1.2                    1.2.12-2
ii  libsdl-mixer1.2                    1.2.12-3
ii  libsdl-ttf2.0-0                    2.0.11-2
ii  libsdl1.2debian                    1.2.15-5
ii  ttf-liberation                     1.07.2-5

Versions of packages freedink-engine recommends:
ii  freedink-dfarc  3.10-1

freedink-engine suggests no packages.

-- no debconf information
--- dinkvar.c.old	2012-09-23 13:21:04.950155940 +0200
+++ dinkvar.c	2012-09-23 13:21:54.010476717 +0200
@@ -3932,13 +3932,15 @@ void copy_bmp(char* name)
                 myseq += (rand () % randy);
                 
                 int crap2 = add_sprite(mx,my,5,myseq,1);
-                spr[crap2].speed = 0;
-                spr[crap2].base_walk = -1;
-                spr[crap2].nohit = 1;
-                spr[crap2].seq = myseq;
-                if (sprite > 0)
-                        spr[crap2].que = spr[sprite].y+1;
-
+		if (crap2 > 0)
+		  {
+                    spr[crap2].speed = 0;
+                    spr[crap2].base_walk = -1;
+                    spr[crap2].nohit = 1;
+                    spr[crap2].seq = myseq;
+                    if (sprite > 0)
+                            spr[crap2].que = spr[sprite].y+1;
+		  }
         }
 
 

Reply via email to