some little fixes

This commit is contained in:
False.Genesis 2007-08-20 16:16:33 +00:00
parent f8393d44e7
commit 12b508fc9f
4 changed files with 24 additions and 4 deletions

View File

@ -41,9 +41,6 @@ ELSE
ENDIF
UNSET errors
// loads & applies the configuration
CONFIG
// Load some SCP files
LOADALLSCP

View File

@ -37,6 +37,10 @@ LOGDETAIL * Dangerous variables removed.
#script=config
#permission=255
//-----------------------------------------------
#onload
// create empty variable. stores if config script was already run successfully once.
SET,DONE
#/onload
// Load all conf files from directory /conf/
// get all *.conf file names from /conf/ directory, store the names in list 'fl' and the amount in 'fcount'
LOG ** Configuring PseuWoW...
@ -84,6 +88,7 @@ INTERNAL_PERM
DEFAULT,#CMDCHAR .
LOG ** All Config done.
SET,DONE true
//--------------------------------------------------
@ -98,3 +103,16 @@ LOG * Assigning permissions for internal functions...
setscriptpermission,emote 0
// ... set more permissions here ...
// this dummy script does nothing actually but since its loaded last in this file it causes the config
// script to be run before all .def files are loaded
// (this is important for scripts that depend on the config already existing during load-time)
//-------------------------------------------------
#script=dummy
//-------------------------------------------------
#onload
if ?{not ${#config::DONE}}
config
endif
#/onload

View File

@ -252,7 +252,10 @@ bool DefScriptPackage::LoadScriptFromFile(std::string fn){
curScript->SetDebug(true);
}
else if(line=="onload")
Script[SN_ONLOAD] = curScript = new DefScript(this);
{
_UpdateOrCreateScriptByName(SN_ONLOAD);
curScript=Script[SN_ONLOAD];
}
else if(line=="endonload" || line=="/onload")
{
RunScript(SN_ONLOAD,NULL,sn);

View File

@ -347,8 +347,10 @@ void PseuInstance::DeleteGUI(void)
PseuInstanceConf::PseuInstanceConf()
{
enablecli=false;
enablegui=false;
exitonerror=false;
debug=0;
rmcontrolport=0;
}
void PseuInstanceConf::ApplyFromVarSet(VarSet &v)