mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Combat code, some scripting, broken network, and fixed some bugs.
This was SVN commit r1301.
This commit is contained in:
+14
-2
@@ -13,6 +13,8 @@
|
||||
#include "Network/Client.h"
|
||||
#include "Network/Server.h"
|
||||
|
||||
#include "Interact.h"
|
||||
|
||||
extern bool keys[SDLK_LAST];
|
||||
|
||||
CConsole::CConsole()
|
||||
@@ -497,14 +499,24 @@ void CConsole::ProcessBuffer(const wchar_t* szLine){
|
||||
{
|
||||
// Process it as JavaScript
|
||||
|
||||
g_ScriptingHost.ExecuteScript( CStrW( szLine + 1 ) );
|
||||
// (Cheating) run it as the first selected entity, if there is one.
|
||||
JSObject* RunAs = NULL;
|
||||
if( g_Selection.m_selected.size() )
|
||||
RunAs = g_Selection.m_selected[0]->GetScript();
|
||||
|
||||
g_ScriptingHost.ExecuteScript( CStrW( szLine + 1 ), L"Console", RunAs );
|
||||
|
||||
}
|
||||
else if (szLine[0] == '?')
|
||||
{
|
||||
// Process it as JavaScript and display the result
|
||||
|
||||
jsval rval = g_ScriptingHost.ExecuteScript( CStrW( szLine + 1 ) );
|
||||
// (Cheating) run it as the first selected entity, if there is one.
|
||||
JSObject* RunAs = NULL;
|
||||
if( g_Selection.m_selected.size() )
|
||||
RunAs = g_Selection.m_selected[0]->GetScript();
|
||||
|
||||
jsval rval = g_ScriptingHost.ExecuteScript( CStrW( szLine + 1 ), L"Console", RunAs );
|
||||
if (rval)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user