Giter Club home page Giter Club logo

factorio-closestfirst's People

Contributors

audun avatar ldnunes avatar roquedeicide avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

factorio-closestfirst's Issues

Small improvements

Just some notes on your use of the api: https://github.com/audun/factorio-closestfirst/blob/master/control.lua#L276
You check valid and connected here. That is useless. game.connected_players will only give you connected and valid players.

Unless you have a save from an old mod version where your on_init didnt exist, global.close_entities == nil will never be true.
If there is an older version of the mod where the global doesnt exist, simply create it in on_configuration_changed instead of checking for it everywhere.

When accessing the player inventory or quickbar, I recommend use of LuaControl::get_[main_inventory/quickbar] because it will work for any type of controller instead of just the character controller.

Find entities filtered allows big performance gains over simply getting all entities in an area. You could filter to only find things from the player's force and the neutral force. Yes, I am aware of your modding interface request to make it even more useful for you :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.