by FDARI » Fri Sep 26, 2014 1:12 pm
Aaptr_playernum(int number): Create a player pointer selector. Aaptr_playernum(0)...Aaptr_playernum(7) can be used in place of AAPTR_PLAYER1...AAPTR_PLAYER8. Aaptr_playernum(8)...Aaptr_playernum(127) have no current purpose, but will automatically work if zdoom player limits are increased. Thus the pointer selection system for players can keep up until zdoom supports more than 128 players.
The function exists for Decorate and ACS.
The old constants (AAPTR_PLAYER#) work exactly as they always have.
It would be possible to raise the limit further than 128, but by the time that might be relevant, we'll all be bathing in milk and Doomscript.
Special notes:
Trying to generate a selector value that does not fit (playernumber < 0, playernumber >= 128) will result in the selector AAPTR_NULL being returned.
Trying to resolve a selector to a player-pointer that isn't in the game returns null, as it has always done.
A player that isn't supported (player 9/Aaptr_playernum(8) and upwards) isn't in the game.
Also: I think... I might have come far enough actually to create a pull-request on this one.
What's the preferred approach here? Do everything via Github and not bother with the code submissions forum? I haven't kept up with you guys.
EDIT: Oh... I missed the ACC patch, naturally. A single new zspecial entry. Too tired to fix now.
Question of memory management: When you delete a FxGlobalFunctionCall, is every expression in its ArgsList also deleted?
- Attachments
-
- moreplayerpointers.patch.txt
- (5.82 KiB) Downloaded 82 times
Aaptr_playernum(int number): Create a player pointer selector. Aaptr_playernum(0)...Aaptr_playernum(7) can be used in place of AAPTR_PLAYER1...AAPTR_PLAYER8. Aaptr_playernum(8)...Aaptr_playernum(127) have no current purpose, but will automatically work if zdoom player limits are increased. Thus the pointer selection system for players can keep up until zdoom supports more than 128 players.
The function exists for Decorate and ACS.
The old constants (AAPTR_PLAYER#) work exactly as they always have.
It would be possible to raise the limit further than 128, but by the time that might be relevant, we'll all be bathing in milk and Doomscript.
Special notes:
Trying to generate a selector value that does not fit (playernumber < 0, playernumber >= 128) will result in the selector AAPTR_NULL being returned.
Trying to resolve a selector to a player-pointer that isn't in the game returns null, as it has always done.
A player that isn't supported (player 9/Aaptr_playernum(8) and upwards) isn't in the game.
Also: I think... I might have come far enough actually to create a pull-request on this one.
What's the preferred approach here? Do everything via Github and not bother with the code submissions forum? I haven't kept up with you guys.
EDIT: Oh... I missed the ACC patch, naturally. A single new zspecial entry. Too tired to fix now.
Question of memory management: When you delete a FxGlobalFunctionCall, is every expression in its ArgsList also deleted?