blob: 5d37775a425112af5a361f3f419e11a9f44a053e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
function script stringToBodytype {
switch (ord(strtolower(charat(getarg(0, "n"), 0)))) {
case 50: // 2
case 102: // f
return BODYTYPE_2;
case 51: // 3
case 109: // m
return BODYTYPE_3;
default:
return BODYTYPE_1;
}
}
function script bodytypeToString {
.@bodytype = getarg(0, BodyType);
return .@bodytype == BODYTYPE_2 ? l("type %i", 2) :
.@bodytype == BODYTYPE_3 ? l("type %i", 3) : l("type %i", 1);
}
|