
r4297 Startup FloatbobPhase Error
Moderator: GZDoom Developers
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.
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.
r4297 Startup FloatbobPhase Error
On starting r4297 this error is reported in the startup window.


Re: r4297 Startup FloatbobPhase Error
I'm still getting the same error. I did a clean and rebuild of the project just in case.


-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: r4297 Startup FloatbobPhase Error
... this patch fixes the problem for me:
Also, I can't find any documentation in the code on how these properties work...
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]");
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: r4297 Startup FloatbobPhase Error
F*ck!
That happens when you don't have time to test such minor changes properly...
That happens when you don't have time to test such minor changes properly...

Re: r4297 Startup FloatbobPhase Error
I should note that FloatBobPhase can never be less then 0, as it's defined as a byte in actor.h.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: r4297 Startup FloatbobPhase Error
... 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
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.
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: r4297 Startup FloatbobPhase Error
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 ();
-
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: r4297 Startup FloatbobPhase Error
uh, is it okay to leave 'rng()' like that? you limit the floatbobphase range to [-1,63], but rng() has range [0,255].
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49230
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: r4297 Startup FloatbobPhase Error
It doesn't really matter. The upper 2 bits get masked out when using the variable.