mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Implementation - Add `amount` to CanRemove script - Add `split_from` to OnRemove script * Tests * Add docs and core-changes * Fix tests... maybe? * Restore testing for client events in container event tests
31 lines
658 B
C++
31 lines
658 B
C++
use uo;
|
|
|
|
const IGNORE_TEST:=255; // only valid for setup or programs
|
|
|
|
function ret_error(str)
|
|
return error{errortext:=str};
|
|
endfunction
|
|
|
|
function ret_error_not_equal( actual, expected, message )
|
|
if ( actual != expected )
|
|
return ret_error( $"{message}" );
|
|
endif
|
|
|
|
return 1;
|
|
endfunction
|
|
|
|
function createAccountWithChar(accname, psw)
|
|
var a:=FindAccount(accname);
|
|
if (!a)
|
|
a:=CreateAccount(accname,psw,1);
|
|
if (!a)
|
|
return ret_error("Failed to create account");
|
|
endif
|
|
a.addcharacter(0);
|
|
endif
|
|
var char:=a.getcharacter(1);
|
|
if (!char)
|
|
return ret_error("Could not find char at slot 1");
|
|
endif
|
|
return char;
|
|
endfunction
|