diff --git a/ctf/core.lua b/ctf/core.lua index 53702e8..9e566cf 100644 --- a/ctf/core.lua +++ b/ctf/core.lua @@ -146,6 +146,7 @@ function ctf.init() ctf._set("hud", true) ctf._set("autoalloc_on_joinplayer", true) ctf._set("friendly_fire", true) + ctf._set("spawn_offset", "0,0,0") for i = 1, #ctf.registered_on_init do diff --git a/ctf/teams.lua b/ctf/teams.lua index d64b94e..efc1bab 100644 --- a/ctf/teams.lua +++ b/ctf/teams.lua @@ -362,8 +362,12 @@ end -- updates the spawn position for a team function ctf.get_spawn(team) - if ctf.team(team) and ctf.team(team).spawn then - return ctf.team(team).spawn + if ctf.team(team) then + local spawn = ctf.team(team).spawn + if not spawn then + return nil + end + return vector.add(spawn, minetest.string_to_pos(ctf.setting("spawn_offset"))) else return nil end diff --git a/doc_settings.md b/doc_settings.md index 7a94c12..68e999a 100644 --- a/doc_settings.md +++ b/doc_settings.md @@ -1,27 +1,28 @@ -# ctf mod +# ctf | name | default value | description | | -------------------------- | ------------- | ---------------------------------------------------------------- | | allocate_mode | 0 | 0=off, 1=firstnonfullteam, 2=RandomOfSmallestTwo, 3=SmallestTeam | | autoalloc_on_joinplayer | true | Trigger auto alloc on join player | -| default_diplo_state | war | war, alliance or peace | -| diplomacy | true | is diplomacy enabled | -| friendly_fire | true | true if players can't hit other players on their team | -| maximum_in_team | -1 | player cap | +| default_diplo_state | "war" | "war", "alliance" or "peace" | +| diplomacy | true | Is diplomacy enabled | +| friendly_fire | true | True if players can't hit other players on their team | +| maximum_in_team | -1 | Player cap | | players_can_change_team | true | | | hud | true | Enable HUD | | gui | true | Enable GUI | | gui.team | true | Whether to show team gui (/team) | -| gui.team.initial | news | Initial tab | +| gui.team.initial | "news" | Initial tab | | gui.tab.diplo | true | Show diplo tab | | gui.tab.news | true | Show news tab | | gui.tab.settings | true | Show settings tab | +| spawn_offset | {x=0, y=0, z=0} | Offset of static spawn-point from team-base | # ctf_chat | name | default value | description | | -------------------------- | ------------- | ---------------------------------------------------------------- | -| chat.default | global | global or team | +| chat.default | "global" | "global" or "team" | | chat.global_channel | true | | | chat.team_channel | true | | @@ -37,17 +38,17 @@ | name | default value | description | | -------------------------- | ------------- | ---------------------------------------------------------------- | -| flag.alerts | true | prompts like "X has captured your flag" | -| flag.alerts.neutral_alert | true | show prompt in neutral state, ie: "attack and defend!" | -| flag.allow_multiple | true | teams can have multiple flags | -| flag.capture_take | false | whether a player needs to return flag to base to capture | -| flag.drop_time | 420 | time in seconds before a player drops the flag they're holding | -| flag.drop_warn_time | 60 | warning time before drop | -| flag.nobuild_radius | 3 | area around flag where you can't build | -| flag.names | true | enable naming flags | -| flag.protect_distance | 25 | area protection distance | -| flag.waypoints | true | enable waypoints to flags | -| flag.crafting | false | enable the crafting of flags | | +| flag.alerts | true | Prompts like "X has captured your flag" | +| flag.alerts.neutral_alert | true | Show prompt in neutral state, ie: "attack and defend!" | +| flag.allow_multiple | true | Teams can have multiple flags | +| flag.capture_take | false | Whether a player needs to return flag to base to capture | +| flag.drop_time | 420 | Time in seconds before a player drops the flag they're holding | +| flag.drop_warn_time | 60 | Warning time before drop | +| flag.nobuild_radius | 3 | Area around flag where you can't build | +| flag.names | true | Enable naming flags | +| flag.protect_distance | 25 | Area protection distance | +| flag.waypoints | true | Enable waypoints to flags | +| flag.crafting | false | Enable the crafting of flags | | gui.tab.flags | true | Show flags tab | | gui.team.teleport_to_flag | true | Enable teleport to flag button in flags tab | | gui.team.teleport_to_spawn | false | Enable teleport to spawn button in flags tab | @@ -56,4 +57,4 @@ | name | default value | description | | -------------------------- | ------------- | ---------------------------------------------------------------- | -| node_ownership | true | whether node protection per team is enabled +| node_ownership | true | Whether node protection per team is enabled |