Has "player.mo.target" changed?

I'm trying to port Cream (no, I haven't asked for permission yet) and I'm running into issues with the Lua related to Cheese attacking.
Cheese works as it should, except for targetting enemies.
I eventually isolated the issue, it it resulted in being "player.mo.cheese.target = player.mo.target" which returns nil.
There's "P_LookForEnemies(player)" which is checking for enemies near the player, but "player.mo.target" still returns nil.
I can only assume this has something to do with the new targetting system in 2.2, so I'm looking for help activating that in the long run.
 
In 2.1, P_LookForEnemies automatically set the player's target and returned truthy if it found one. In 2.2, P_LookForEnemies does not automatically set the player's target—instead, if returns the mobj found in the search (or nil, if it did not find one).

You can either store the value of P_LookForEnemies in a local variable and set the player's target to it if it is not nil, or you can set player.mo.target to the return value of P_LookForEnemies directly if a return value of nil is not context-invasive.
 
And now we see why the change was brilliant! :P
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top