[Commits] [wesnoth/wesnoth] 4a6042: fix crash on #wesnoth.unit_types

GitHub noreply at github.com
Wed Jan 24 17:08:20 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 4a6042a3c95a14695279d090acf6cfd295899b0e
      https://github.com/wesnoth/wesnoth/commit/4a6042a3c95a14695279d090acf6cfd295899b0e
  Author: Gregory A Lundberg <gregory_lundberg at gmx.com>
  Date:   2018-01-24 (Wed, 24 Jan 2018)

  Changed paths:
    M src/scripting/lua_unit_type.cpp

  Log Message:
  -----------
  fix crash on #wesnoth.unit_types

`#wesnoth.unit_types` should simply return the number of unit types.

This fixes the crash and reports the correct value: the number of unit types defined.

This does not fix the rest of the crap like pairs() crawls, you can't interate variations or get the variation count.

My knee-jerk reaction is to delete all scripting support for unit_types so that it's filed where it belongs: in the Trash. But, what the hell, nobody has complained about what utter shit this code is, so I'll just fix this so we don't crash and carry on working on getting the code to actually do what it's supposed to instead of the lame-ass shit it currently does.

Can you tell what I think of this file?

closes #2381





More information about the Commits mailing list