Skip to content

Conversation

@hexd0t
Copy link
Contributor

@hexd0t hexd0t commented Mar 25, 2025

Calling DaedalusSymbol.get_int on a const integer Symbol fails.

Simple test case:

script = DaedalusScript.load(sys.argv[1]) #point to GOTHIC.DAT
# cast is imported from typing and is just there to placate static analysis about the None return:
svm_count = cast(DaedalusSymbol, script.get_symbol_by_name("SVM_MODULES")).get_int()
print(f"SVM count: {svm_count}")

Line 2 fails with:

    svm_count = cast(DaedalusSymbol, script.get_symbol_by_name("SVM_MODULES")).get_int()
  File "venv/lib/python3.13/site-packages/zenkit/daedalus_script.py", line 128, in get_int
    return DLL.ZkDaedalusSymbol_getInt(self._handle, c_uint16(i), ctx.handle if ctx else None).value
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'value'

Removing the .value makes this return the expected int value.

(This might also affect get_float, but I haven't tested that)

@kamilkrzyskow
Copy link

kamilkrzyskow commented Mar 25, 2025

Hi @hexd0t,
yes, this affects all of the get functions and a fix would be part of:

which got a bit stale, but not abandoned. ✌️

Do you need this kind of fix sooner and should I split up the PR into smaller ones or can I take my time?

EDIT:
I answered too fast to notice it's a PR 🤩 I thought it's an Issue.
So yeah, if you make fixes and PR sooner, then I can rebase later, no need to wait for me ✌️

@lmichaelis lmichaelis added the bug Something isn't working label Mar 30, 2025
@lmichaelis
Copy link
Member

Heyo @hexd0t, thanks for the fix! Merged :)

@lmichaelis lmichaelis merged commit 12e83c2 into GothicKit:main Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants