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:
MarkT
2005-01-18 00:46:18 +00:00
parent 4b5aff926d
commit 25fdbfd931
13 changed files with 135 additions and 14 deletions
+15
View File
@@ -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 )