~armagetronad-ct/armagetronad/0.2.8-armagetronad-sty+ct+lua

« back to all changes in this revision

Viewing changes to src/tron/gGame.cpp

yet another try to add scripting support

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
#include "gParser.h"
75
75
#include "tResourceManager.h"
76
76
#include "nAuthentication.h"
 
77
#include "tLuaScript.h"
77
78
 
78
79
#include <math.h>
79
80
#include <stdlib.h>
3294
3295
            command << "rinclude " << filename;
3295
3296
            tConfItemBase::LoadLine(command);
3296
3297
        }
 
3298
        // load map lua file
 
3299
        filename = std::string(mapfile);
 
3300
        pos = filename.find(".aamap.xml",filename.length()-10);
 
3301
        if (pos!=std::string::npos) {
 
3302
            filename.replace(pos,10,".lua");
 
3303
            LuaState::Instance->LoadRemote(filename);
 
3304
        }
3297
3305
    }
3298
3306
 
3299
3307
    if (mapFD)
3850
3858
                    gGame::NetSyncIdle();
3851
3859
                }
3852
3860
 
 
3861
                eLadderLogWriter::clearAllLuaRefs();
 
3862
                LuaState::Restart();
 
3863
 
3853
3864
                {
3854
3865
                    // default include files are executed at owner level
3855
3866
                    tCurrentAccessLevel level( tAccessLevel_Owner, true );