SXF_IS<TARGET/MASTER/TRACER> Flags

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Major Cooke »

Based off of http://forum.zdoom.org/viewtopic.php?f=15&t=49295

Here's the pull request.

All it does is set the spawned actor as the calling actor's respective pointer(s).
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Fishytza »

Didn't want to double post in the other thread so I'm posting here instead.

I think I realized a potential problem. How dangerous is it having two monsters as each other's master? Because now it's possible for that to happen by specifying SXF_SETMASTER|SXF_ISMASTER. Shouldn't there be a safety check of some sort?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by NeuralStunner »

Is there some function that climbs up a chain of Master pointers? I think that's the only place it'd be an issue.
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Major Cooke »

Read.

Short version, it'll be fine as long as you don't attempt to do anything too spectacular or stupid with it.

And remember, SXF_ORIGINATOR does not affect setting of master for the calling actor. It only affects transference to the spawned child.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Fishytza »

I'm sorry, but could you tell me why you linked me to the A_TransferPointer page? I was talking about A_SpawnItemEx specifically.
I also realized something even more dangerous: what if both calling actor and spawning actor are missiles and you specify SXF_SETTARGET|SXF_ISTARGET?

But back to the page you linked, is this what you wanted me to read?:
A_TransferPointer page wrote:By default MASTER and TARGET become null if values are assigned that would cause infinite relationships. (Missiles targeting each other, masters mastering each other.)
The following flags can manipulate and disable the safe guards to allow for more complex relationships:

PTROP_UNSAFETARGET (1) - Don't null assignments that result in an infinite chain of missiles referencing each other
PTROP_UNSAFEMASTER (2) - Don't null assignments that result in an infinite chain of actors referencing each other
PTROP_NOSAFEGUARDS (4) - Same as putting in PTROP_UNSAFETARGET|PTROP_UNSAFEMASTER, or 3 (3 and 4 do the same thing, which is redundant).
IIRC A_SpawnItemEx doesn't have such safety checks.
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Major Cooke »

The point is, it's not too terribly dangerous if you're careful. Just don't do anything stupid or spectacular and you'll be fine.
User avatar
Fishytza
Posts: 793
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Fishytza »

Heh, you don't have to tell me that.

By the way, I noticed you changed your mind about the 'originator'.
How come?
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Major Cooke »

The moment I opened the pull request, I closed it. It still shows up in the log regardless. Doesn't mean its in.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: SXF_IS<TARGET/MASTER/TRACER> Flags

Post by Graf Zahl »

The changelog doesn't filter the pull requests from actual repo contents. Which IMO is a bug in itself, but since I got no access to the server I cannot fix it.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”