aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/base_scriptable.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-26 15:59:26 +0200
committerEinar Johan Trøan Sømåen2012-07-26 15:59:26 +0200
commitef11f9d0c53cbdd9d88a99143de6f43f34d7e24d (patch)
tree8dfaee0ba16e18a8e3772dd5afc9123d5c4e78d2 /engines/wintermute/base/base_scriptable.cpp
parent38507fa9895620639d8733dbb4e085dfb2282a33 (diff)
downloadscummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.tar.gz
scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.tar.bz2
scummvm-rg350-ef11f9d0c53cbdd9d88a99143de6f43f34d7e24d.zip
WINTERMUTE: Run Astyle with add-braces to break one-line statements into easier-to-read-code.
Diffstat (limited to 'engines/wintermute/base/base_scriptable.cpp')
-rw-r--r--engines/wintermute/base/base_scriptable.cpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/engines/wintermute/base/base_scriptable.cpp b/engines/wintermute/base/base_scriptable.cpp
index 4059abde3d..ad89b63d65 100644
--- a/engines/wintermute/base/base_scriptable.cpp
+++ b/engines/wintermute/base/base_scriptable.cpp
@@ -38,8 +38,11 @@ IMPLEMENT_PERSISTENT(BaseScriptable, false)
BaseScriptable::BaseScriptable(BaseGame *inGame, bool noValue, bool persistable): BaseNamedObject(inGame) {
_refCount = 0;
- if (noValue) _scValue = NULL;
- else _scValue = new ScValue(_gameRef);
+ if (noValue) {
+ _scValue = NULL;
+ } else {
+ _scValue = new ScValue(_gameRef);
+ }
_persistable = persistable;
@@ -74,17 +77,27 @@ bool BaseScriptable::scCallMethod(ScScript *script, ScStack *stack, ScStack *thi
//////////////////////////////////////////////////////////////////////////
ScValue *BaseScriptable::scGetProperty(const char *name) {
- if (!_scProp) _scProp = new ScValue(_gameRef);
- if (_scProp) return _scProp->getProp(name);
- else return NULL;
+ if (!_scProp) {
+ _scProp = new ScValue(_gameRef);
+ }
+ if (_scProp) {
+ return _scProp->getProp(name);
+ } else {
+ return NULL;
+ }
}
//////////////////////////////////////////////////////////////////////////
bool BaseScriptable::scSetProperty(const char *name, ScValue *value) {
- if (!_scProp) _scProp = new ScValue(_gameRef);
- if (_scProp) return _scProp->setProp(name, value);
- else return STATUS_FAILED;
+ if (!_scProp) {
+ _scProp = new ScValue(_gameRef);
+ }
+ if (_scProp) {
+ return _scProp->setProp(name, value);
+ } else {
+ return STATUS_FAILED;
+ }
}
@@ -150,9 +163,13 @@ bool BaseScriptable::persist(BasePersistenceManager *persistMgr) {
//////////////////////////////////////////////////////////////////////////
int BaseScriptable::scCompare(BaseScriptable *val) {
- if (this < val) return -1;
- else if (this > val) return 1;
- else return 0;
+ if (this < val) {
+ return -1;
+ } else if (this > val) {
+ return 1;
+ } else {
+ return 0;
+ }
}
//////////////////////////////////////////////////////////////////////////