mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 06:58:07 +00:00
- Linux/GCC (as usual :P)
- Ported lockless code to gcc inline assembly - A few new net messages (gather, attack, add waypoint) - Support for new messages in network->entity order converter - Implemented rudimentary JS interface for Interaction - issueCommand JS API, connected to the network - Removed Interaction stuff now replaced by JS - And something in there should probably break VS builds :P This was SVN commit r2316.
This commit is contained in:
@@ -91,48 +91,3 @@ JSBool JSI_Selection::setGroups( JSContext* context, JSObject* obj, jsval id, js
|
||||
|
||||
return( JS_TRUE );
|
||||
}
|
||||
|
||||
JSBool JSI_Selection::isValidContextOrder( JSContext* context, JSObject* obj, unsigned int argc, jsval* argv, jsval* rval )
|
||||
{
|
||||
assert( argc >= 1 );
|
||||
int orderCode;
|
||||
try
|
||||
{
|
||||
orderCode = g_ScriptingHost.ValueToInt( argv[0] );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
JS_ReportError( context, "Invalid order type" );
|
||||
*rval = BOOLEAN_TO_JSVAL( false );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
*rval = BOOLEAN_TO_JSVAL( g_Selection.isContextValid( orderCode ) );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
|
||||
JSBool JSI_Selection::getContextOrder( JSContext* context, JSObject* obj, jsval id, jsval* vp )
|
||||
{
|
||||
*vp = INT_TO_JSVAL( g_Selection.m_contextOrder );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
|
||||
JSBool JSI_Selection::setContextOrder( JSContext* context, JSObject* obj, jsval id, jsval* vp )
|
||||
{
|
||||
int orderCode;
|
||||
try
|
||||
{
|
||||
orderCode = g_ScriptingHost.ValueToInt( *vp );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
JS_ReportError( context, "Invalid order type" );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
if( !g_Selection.isContextValid( orderCode ) )
|
||||
{
|
||||
JS_ReportError( context, "Order is not valid in this context: %d", orderCode );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
g_Selection.setContext( orderCode );
|
||||
return( JS_TRUE );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user