Ticket #58 (new defect)

Opened 9 months ago

Last modified 9 months ago

iPcSpawn::AddEntityType() is not usable from Python

Reported by: glibersat Owned by:
Priority: minor Milestone:
Component: python Version:
Keywords: Cc:

Description

IPcSpawn::AddEntityType() uses variadic paramaters but SWIG, by default, puts a NULL value for this argument list.

This makes this method not usable from Python since you can't pass propclasses to create your entities.

The attached patch fixes this issue by allowing at most 10 propclasses to be passed to the function. This is the most straightforward way to fix it and should be sufficient to cover all usages.

Attachments

cel_fix_ipcspawn_addentitytype.diff (0.5 kB) - added by glibersat 9 months ago.
Fix

Change History

Changed 9 months ago by glibersat

Fix

Changed 9 months ago by sunshine

As a more complete solution, I would suggest enhancing the underlying C++ API with an AddEntityType() overload which accepts an array of types as the final argument. Not only does this complement the existing variadic overload, but it is also much more amenable to scripting bindings, and would allow script writers to assign any number of entity types by passing in a script-side native collection.

Add/Change #58 (iPcSpawn::AddEntityType() is not usable from Python)

Author



Action
as new
 
Note: See TracTickets for help on using tickets.