(script: ScriptState, protect: boolean = false, force: boolean = false)
| 2200 | } |
| 2201 | return false; |
| 2202 | } |
| 2203 | |
| 2204 | // copied from client |
| 2205 | isInWilderness(): boolean { |
| 2206 | if (this.x >= 2944 && this.x < 3392 && this.z >= 3520 && this.z < 6400) { |
| 2207 | return true; |
| 2208 | } else if (this.x >= 2944 && this.x < 3392 && this.z >= 9920 && this.z < 12800) { |
| 2209 | return true; |
| 2210 | } else { |
| 2211 | return false; |
| 2212 | } |
| 2213 | } |
| 2214 | |
| 2215 | // ---- |
| 2216 | |
| 2217 | runScript(script: ScriptState, protect: boolean = false, force: boolean = false) { |
| 2218 | if (!force && protect && (this.protect || this.delayed)) { |
| 2219 | // can't get protected access, bye-bye |
| 2220 | // printDebug('No protected access:', script.script.name, protect, this.protect); |
| 2221 | return -1; |
| 2222 | } |
| 2223 | |
| 2224 | if (protect) { |
| 2225 | script.pointerAdd(ScriptPointer.ProtectedActivePlayer); |
| 2226 | this.protect = true; |
| 2227 | } |
| 2228 | |
| 2229 | const state = ScriptRunner.execute(script); |
| 2230 | |
| 2231 | if (protect) { |
| 2232 | this.protect = false; |
no test coverage detected