Return only one of two results?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Return only one of two results?

Postby Matt » Thu Mar 01, 2018 8:01 pm

So I find myself calling A_SpawnItemEx a lot using SXF_NOCHECKPOSITION and wanting to do further stuff with the actor spawned. This means I must get the returned actor, but the returned bool is totally useless to me.

Something similar happens with the int returned by LineAttack.

Is there a way to return only the actor, or dump the other return into a dev/null like thing so I don't have to define a new garbage int/bool in this situation?
Last edited by Matt on Thu Mar 01, 2018 9:11 pm, edited 1 time in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Return only one of two results?

Postby phantombeta » Thu Mar 01, 2018 8:03 pm

As far as I know, no, you need to get both return values.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests