by argv » Mon Jul 09, 2018 2:38 am
No problem. Here's a runnable sample of the issue. Once you load it up, there are two things to try:
- summon DoomedImp. This will summon an imp which immediately dies. It drops a RandomSpawner, which becomes either a Clip or Shell. When you pick up the resulting item, it reports whether its TOSSED flag is set.
- summon DoomedPinky. This will summon a pinky which immediately dies. It directly drops a Shell, which also reports whether its TOSSED flag is set.
You'll see that items dropped by the DoomedPinky do have the TOSSED flag set (because no RandomSpawner), while items dropped by the DoomedImp don't (because RandomSpawner).
The big problem I see here is that TOSSED is defined on the Inventory class, but RandomSpawner does not inherit from Inventory, so it doesn't
have a TOSSED flag.
Is it perhaps feasible to move this flag to the Actor class instead? It is, after all, perfectly valid to name non-Inventory classes as DropItems, and to call A_DropItem with a non-Inventory class. If this is done, the SpecialDropAction method should probably also be moved to the Actor class.
- Attachments
-
- tossed-demo.pk3
- (1002 Bytes) Downloaded 78 times
No problem. Here's a runnable sample of the issue. Once you load it up, there are two things to try:
[list]
[*]summon DoomedImp. This will summon an imp which immediately dies. It drops a RandomSpawner, which becomes either a Clip or Shell. When you pick up the resulting item, it reports whether its TOSSED flag is set.
[*]summon DoomedPinky. This will summon a pinky which immediately dies. It directly drops a Shell, which also reports whether its TOSSED flag is set.[/list]
You'll see that items dropped by the DoomedPinky do have the TOSSED flag set (because no RandomSpawner), while items dropped by the DoomedImp don't (because RandomSpawner).
The big problem I see here is that TOSSED is defined on the Inventory class, but RandomSpawner does not inherit from Inventory, so it doesn't [i]have[/i] a TOSSED flag.
Is it perhaps feasible to move this flag to the Actor class instead? It is, after all, perfectly valid to name non-Inventory classes as DropItems, and to call A_DropItem with a non-Inventory class. If this is done, the SpecialDropAction method should probably also be moved to the Actor class.