mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-13 15:34:37 +00:00
Fixes for two pathfinding bugs (neither of which were actually pathfinding bugs), added player objects (details in TM)
This was SVN commit r1733.
This commit is contained in:
@@ -19,6 +19,21 @@ template<> JSObject* ToScript<HEntity>( HEntity* Native )
|
||||
return( ToScript<CEntity>( &( **Native ) ) );
|
||||
}
|
||||
|
||||
// CPlayer*
|
||||
template<> bool ToPrimitive<CPlayer*>( JSContext* cx, jsval v, CPlayer*& Storage )
|
||||
{
|
||||
if( !JSVAL_IS_OBJECT( v ) ) return( false );
|
||||
CPlayer* Data = (CPlayer*)JS_GetInstancePrivate( cx, JSVAL_TO_OBJECT( v ), &CPlayer::JSI_class, NULL );
|
||||
if( !Data ) return( false );
|
||||
Storage = Data;
|
||||
return( true );
|
||||
}
|
||||
|
||||
template<> JSObject* ToScript<CPlayer*>( CPlayer** Native )
|
||||
{
|
||||
return( ToScript<CPlayer>( *Native ) );
|
||||
}
|
||||
|
||||
// CBaseEntity*
|
||||
|
||||
template<> bool ToPrimitive<CBaseEntity*>( JSContext* cx, jsval v, CBaseEntity*& Storage )
|
||||
|
||||
Reference in New Issue
Block a user