citymania-org / grf-py

A Python framework for making NewGRFs for OpenTTD
GNU General Public License v2.0
14 stars 3 forks source link

(callback manager) Set properties to none when appropriate #5

Closed ahyangyi closed 1 year ago

ahyangyi commented 1 year ago

Things other than vehicles have callbacks but no properties. Hence, setting properties to None gives an easy way to avoid looking into it when it might not exist.

ldpl commented 1 year ago

Superseded by 83e0443 Setting properties to None is not a good solution IMO, it should give AttributeError like any other non-existing attribute. So I used a slightly different approach to fix CallbackManager for non-vehicles.