X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fsandbox.qc;h=d7fec13264e5cc70bdfa10e02a21570d0b1d7c50;hb=fcbf9538330960b989dbe84e7188349d7e8b109f;hp=66377d1d84aade6398814d045f04926cefdc7d17;hpb=37b68c473f411c96bd746069ccc915a04447a15c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 66377d1d8..d7fec1326 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -205,7 +205,7 @@ string port_string[MAX_STORAGE_ATTACHMENTS]; // fteqcc crashes if this isn't def string sandbox_ObjectPort_Save(entity e, float database) { // save object properties, and return them as a string - float i; + float i = 0; string s; entity head; @@ -268,6 +268,7 @@ string sandbox_ObjectPort_Save(entity e, float database) } // now apply the array to a simple string, with the ; symbol separating objects + s = ""; for(i = 0; i <= MAX_STORAGE_ATTACHMENTS; ++i) { if(port_string[i]) @@ -744,13 +745,16 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) print_to(self, strcat("^2SANDBOX - INFO: ^7Object is owned by \"^7", e.netname, "^7\", created \"^3", e.message, "^7\", last edited \"^3", e.message2, "^7\"")); return TRUE; case "mesh": - for(i = 1; gettaginfo(e, i); i++) + s = ""; + FOR_EACH_TAG(e) s = strcat(s, "^7\"^5", gettaginfo_name, "^7\", "); print_to(self, strcat("^2SANDBOX - INFO: ^7Object mesh is \"^3", e.model, "^7\" at animation frame ^3", ftos(e.frame), " ^7containing the following tags: ", s)); return TRUE; case "attachments": // this should show the same info as 'mesh' but for attachments + s = ""; entity head; + i = 0; for(head = world; (head = find(head, classname, "object")); ) { if(head.owner == e) @@ -794,10 +798,17 @@ MUTATOR_HOOKFUNCTION(sandbox_StartFrame) return TRUE; } +MUTATOR_HOOKFUNCTION(sandbox_SetModname) +{ + modname = "Sandbox"; + return TRUE; +} + MUTATOR_DEFINITION(sandbox) { MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY); MUTATOR_HOOK(SV_StartFrame, sandbox_StartFrame, CBC_ORDER_ANY); + MUTATOR_HOOK(SetModname, sandbox_SetModname, CBC_ORDER_ANY); MUTATOR_ONADD {