Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activator unassigned before call to SUB_UseTargets #13

Open
4LT opened this issue Jan 28, 2024 · 3 comments
Open

activator unassigned before call to SUB_UseTargets #13

4LT opened this issue Jan 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@4LT
Copy link

4LT commented Jan 28, 2024

progs_dump/qc/triggers.qc

Lines 1249 to 1250 in 55960e8

self.use = multi_trigger;
SUB_UseTargets();

SUB_UseTargets is called from a touch context, meaning "other" is guaranteed to be assigned, but there's no guarantee about the "activator" global.

Also, it's not clear to me why multi_trigger is assigned to self.use before SUB_UseTargets is called when multi_trigger calls SUB_UseTargets itself. Seems like a bug, but you're doing something I just don't understand.

@jjelliott jjelliott added the bug Something isn't working label Feb 2, 2024
@dumptruckDS
Copy link
Contributor

This is frankly over my head. This is found in trigger_look (written by nullpoint_paladin). I am not sure what the impact of this bug is?

@4LT
Copy link
Author

4LT commented Mar 8, 2024

I had to dig through some Discord responses to recall what happened

Sometimes, a message from a trigger appears in the top left corner started with (centerprint), instead of in the center. What gives? (tested in ironwail and remaster)

Seems sometimes a non-player entity is found as the "activator" of trigger_look causing the centerprint text to be logged as a broadcast (bprint) message

I also wanted to highlight that the code identified is unusual b/c the function multi_trigger calls SUB_UseTargets

A possible fix is to replace

self.use = multi_trigger; 
SUB_UseTargets(); 

with

self.enemy = other;
multi_trigger();

multi_trigger sets activator to self.enemy, so the "touch-er" other needs to be assigned to self.enemy

=====

In short:

When trigger_look is set to print a message (or trigger an entity that prints a message?), it doesn't know which player to apply the centerprint on

@dumptruckDS
Copy link
Contributor

Thanks for the info - very helpful. This will be fixed for the next release. (Soon.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants