refactor the lua call for limiting a ships maximum speed