Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bad Code
- global shaman = getShaman(TRIBE_BLUE);
- def OnTurn()
- {
- if (!shaman.isNull())
- {
- log(shaman.ThingNum);
- }
- }
- Reason: Shaman may not exist on the next turn and will not become null.
- Correct Code
- global shamanProxy = ObjectProxy(getShaman(TRIBE_BLUE));
- def OnTurn()
- {
- if (!shamanProxy.isNull())
- {
- var t_thing = shamanProxy.get();
- log(t_thing.ThingNum);
- }
- else
- {
- log("Shaman has died");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement