Skip to content

Commit

Permalink
Merge pull request #508 from Kruptein/hotfix/0.22.1
Browse files Browse the repository at this point in the history
Hotfix/0.22.1
  • Loading branch information
Kruptein authored Aug 27, 2020
2 parents 1cfa537 + 8f24cba commit c82a2e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
10 changes: 5 additions & 5 deletions client/src/game/ui/selection/shapecontext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ export default class ShapeContext extends Vue {
const spawnInfo = await requestSpawnInfo(newLocation);
console.log(spawnInfo);
let x: number;
let y: number;
switch (spawnInfo.length) {
case 0:
await (<Game>(
this.$parent.$parent.$parent
)).$refs.confirm.open(
"game.ui.selection.shapecontext.no_spawn_set_title",
"game.ui.selection.shapecontext.no_spawn_set_text",
await (<Game>this.$parent.$parent.$parent).$refs.confirm.open(
this.$t("game.ui.selection.shapecontext.no_spawn_set_title").toString(),
this.$t("game.ui.selection.shapecontext.no_spawn_set_text").toString(),
{ showNo: false, yes: "Ok" },
);
this.close();
Expand Down
21 changes: 12 additions & 9 deletions server/api/socket/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,19 @@ async def get_location_spawn_info(sid: str, location_id: int):
logger.warning(f"{pr.player.name} attempted to retrieve spawn locations.")
return

location = Location.get_by_id(location_id)

data = []

for spawn in json.loads(location.options.spawn_locations):
try:
shape = Shape.get_by_id(spawn)
except Shape.DoesNotExist:
pass
else:
data.append(shape.as_dict(pr.player, True))
try:
location = Location.get_by_id(location_id)
if location.options is not None:
for spawn in json.loads(location.options.spawn_locations):
try:
shape = Shape.get_by_id(spawn)
except Shape.DoesNotExist:
pass
else:
data.append(shape.as_dict(pr.player, True))
except:
logger.exception("Could not load spawn locations")

await sio.emit("Location.Spawn.Info", data=data, room=sid, namespace=GAME_NS)

0 comments on commit c82a2e1

Please sign in to comment.