-
Notifications
You must be signed in to change notification settings - Fork 201
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
Ai.c improvements #517
Ai.c improvements #517
Conversation
pilot.vel() is roughly equivalent to ai.speed()
Come to think of it, do not merge this yet. I will keep pushing changes to further improve ai.c. |
For legacy reasons the AI uses a lot of custom stuff. I always wanted to incorporate the standard Lua modules we have into it. I mean there is a nlua_pilot.c and stuff which should be able to work directly in the AI. This would also allow doing coolre things. |
@bobbens Yep, I'm working now on removing the duplicate functions and having the ai code use the standard ones. |
I also removed code in ai.c defining a 'player' constant. It was unused and interfered with access to the player module
I think this was only needed because ai.pos() returned a lightuserdata
I'm not quite sure which functions should be kept and which removed. For example, It is similar with the |
Currently unused; can be replaced by pilot.stats()
Ok, I think this is in somewhat good shape now, though perhaps some testing is needed to make sure everything is working. I have removed the WIP from the title. |
Use forward declaration of struct to deal with cyclical import.
Haven't looked into it in too much detail, but it looks good. Some of the nice shortcuts have been removed and that makes you use chained commands, but I think it's perfectly mergeable as is. Cheers, |
@bobbens A few shortcuts have been removed, but I think it is worth it for the api consistency. I left in shortcuts like |
This seems to me like a good first step for improving the ai module. Needless to say, it is not the only improvement to be made.