r4297 Startup FloatbobPhase Error

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: r4297 Startup FloatbobPhase Error

Re: r4297 Startup FloatbobPhase Error

by Graf Zahl » Sat Jun 01, 2013 7:53 am

It doesn't really matter. The upper 2 bits get masked out when using the variable.

Re: r4297 Startup FloatbobPhase Error

by Edward-san » Sat Jun 01, 2013 6:48 am

uh, is it okay to leave 'rng()' like that? you limit the floatbobphase range to [-1,63], but rng() has range [0,255].

Re: r4297 Startup FloatbobPhase Error

by Edward-san » Sat Jun 01, 2013 4:29 am

True, you're right. I fixed this with this patch, maybe inelegant:

Code: Select all

Index: src/p_mobj.cpp
===================================================================
--- src/p_mobj.cpp      (revision 4309)
+++ src/p_mobj.cpp      (working copy)
@@ -3878,7 +3878,7 @@
                actor->SpawnPoint[2] = (actor->z - actor->floorz);
        }
 
-       if (actor->FloatBobPhase < 0) actor->FloatBobPhase = rng();     // Don't make everything bob in sync (unless deliberately told to do)
+       if (actor->FloatBobPhase == (BYTE)-1) actor->FloatBobPhase = rng();     // Don't make everything bob in sync (unless deliberately told to do)
        if (actor->flags2 & MF2_FLOORCLIP)
        {
                actor->AdjustFloorClip ();

Re: r4297 Startup FloatbobPhase Error

by edward850 » Sat Jun 01, 2013 4:16 am

Because you are looking at id, not defaults->FloatBobPhase. That's kind of important, otherwise FloatBobPhase can never be -1 at p_mobj: line 3882.

Re: r4297 Startup FloatbobPhase Error

by Edward-san » Sat Jun 01, 2013 4:12 am

... it gives me -1 if I load it normally:

Code: Select all

Breakpoint 1, Handler_floatbobphase_I_Actor (defaults=0xd2a400, info=0xd2a720, 
    bag=..., params=0xd2a8c0)
    at /home/edward-san/zdoom/trunk/src/thingdef/thingdef_properties.cpp:632
632		PROP_INT_PARM(id, 0);
(gdb) print id
$1 = 0
(gdb) next
633		if (id < -1 || id >= 64) I_Error ("FloatBobPhase must be in range [-1,63]");
(gdb) print id
$2 = -1

Re: r4297 Startup FloatbobPhase Error

by edward850 » Sat Jun 01, 2013 3:29 am

I should note that FloatBobPhase can never be less then 0, as it's defined as a byte in actor.h.

Re: r4297 Startup FloatbobPhase Error

by Graf Zahl » Fri May 31, 2013 12:11 pm

F*ck!

That happens when you don't have time to test such minor changes properly... :(

Re: r4297 Startup FloatbobPhase Error

by Edward-san » Fri May 31, 2013 11:07 am

... this patch fixes the problem for me:

Code: Select all

Index: src/thingdef/thingdef_properties.cpp
===================================================================
--- src/thingdef/thingdef_properties.cpp        (revision 4299)
+++ src/thingdef/thingdef_properties.cpp        (working copy)
@@ -627,7 +627,7 @@
 //==========================================================================
 //
 //==========================================================================
-DEFINE_PROPERTY(floatbobphase, F, Actor)
+DEFINE_PROPERTY(floatbobphase, I, Actor)
 {
        PROP_INT_PARM(id, 0);
        if (id < -1 || id >= 64) I_Error ("FloatBobPhase must be in range [-1,63]");
Also, I can't find any documentation in the code on how these properties work...

Re: r4297 Startup FloatbobPhase Error

by Enjay » Fri May 31, 2013 10:48 am

I'm still getting the same error. I did a clean and rebuild of the project just in case.

Image

Re: r4297 Startup FloatbobPhase Error

by Graf Zahl » Thu May 30, 2013 3:12 pm

Hm... I must have hit undo sometime after testing...

fixed in r4299

r4297 Startup FloatbobPhase Error

by Enjay » Thu May 30, 2013 2:06 pm

On starting r4297 this error is reported in the startup window.

Image

Top