libtcod / python-tcod

A high-performance Python port of libtcod. Includes the libtcodpy module for backwards compatibility with older projects.
BSD 2-Clause "Simplified" License
410 stars 36 forks source link

namegen_generate_custom bug #70

Closed FractalWire closed 5 years ago

FractalWire commented 5 years ago

Hey,

I'm having a slight bug with namegen_generate_custom. When I tried that :

self.name = name or tcod.namegen_generate_custom(tmp_sex, "$s")

Python tell me that:

File "characters.py", line 157, in __init__ self.name = name or tcod.namegen_generate_custom(tmp_sex, "$s") File "/home/ogr/src-repos/git-repos/tcod/env/lib/python3.7/site-packages/tcod/libtcodpy.py" line 3183, in namegen_generate_custom lib.TCOD_namegen_generate(_bytes(name), _bytes(rule), False) TypeError: TCOD_namegen_generate expected 2 arguments, got 3

I think it's a bug.

HexDecimal commented 5 years ago

It was calling the wrong libtcod function. I'll assume you want an immediate release of the fix.

FractalWire commented 5 years ago

Yes, that would be great !

Edit : Ah, it's already availbale, thanks !

FractalWire commented 5 years ago

I just upgraded, but the bug seems to still be there, at least for me (I've got the same exact error). Does this work for you ?

Maybe an issue with the packaging ?

I can provide sample data if you need.

HexDecimal commented 5 years ago

It the call itself seems to work for me:

>>> import tcod
>>> tcod.namegen_generate_custom("", "")
The name "" has not been found.
Registered syllable sets are:
''

Be sure to check the value of tcod.__version__, it should be "9.2.5".

FractalWire commented 5 years ago

Ah, I'm using pip to upgrade the package, but it seems the last version there is 9.2.4

HexDecimal commented 5 years ago

I forgot --follow-tags when I pushed this release, 9.2.5 will now deploy.