Skip to content

Commit 288cd80

Browse files
committed
Add p5 and p6 to createentity() scripting command
1 parent 4790d84 commit 288cd80

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

desktop_version/src/Script.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -783,29 +783,19 @@ void scriptclass::run(void)
783783
}
784784
else if (words[0] == "createentity")
785785
{
786-
std::string word6 = words[6];
787-
std::string word7 = words[7];
788-
std::string word8 = words[8];
789-
std::string word9 = words[9];
790-
if (!argexists[6]) words[6] = "0";
791-
if (!argexists[7]) words[7] = "0";
792-
if (!argexists[8]) words[8] = "320";
793-
if (!argexists[9]) words[9] = "240";
794786
obj.createentity(
795787
ss_toi(words[1]),
796788
ss_toi(words[2]),
797789
ss_toi(words[3]),
798790
ss_toi(words[4]),
799791
ss_toi(words[5]),
800-
ss_toi(words[6]),
801-
ss_toi(words[7]),
802-
ss_toi(words[8]),
803-
ss_toi(words[9])
792+
ss_toi(argexists[6] ? words[6] : "0" ),
793+
ss_toi(argexists[7] ? words[7] : "0" ),
794+
ss_toi(argexists[8] ? words[8] : "320"),
795+
ss_toi(argexists[9] ? words[9] : "240"),
796+
ss_toi(argexists[10] ? words[10] : "320"),
797+
ss_toi(argexists[11] ? words[11] : "240")
804798
);
805-
words[6] = word6;
806-
words[7] = word7;
807-
words[8] = word8;
808-
words[9] = word9;
809799
}
810800
else if (words[0] == "createcrewman")
811801
{

0 commit comments

Comments
 (0)