mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-08 04:48:44 +00:00
Fix north pole bug
This commit is contained in:
parent
edaf82c257
commit
1a23108820
2 changed files with 12 additions and 2 deletions
|
@ -65,6 +65,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers {
|
||||||
if(oldSlot == null) return this.NotFound();
|
if(oldSlot == null) return this.NotFound();
|
||||||
if(oldSlot.CreatorId != user.UserId) return this.BadRequest();
|
if(oldSlot.CreatorId != user.UserId) return this.BadRequest();
|
||||||
|
|
||||||
|
oldSlot.Location.X = slot.Location.X;
|
||||||
|
oldSlot.Location.Y = slot.Location.Y;
|
||||||
|
|
||||||
slot.CreatorId = oldSlot.CreatorId;
|
slot.CreatorId = oldSlot.CreatorId;
|
||||||
slot.LocationId = oldSlot.LocationId;
|
slot.LocationId = oldSlot.LocationId;
|
||||||
slot.SlotId = oldSlot.SlotId;
|
slot.SlotId = oldSlot.SlotId;
|
||||||
|
@ -77,8 +80,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers {
|
||||||
|
|
||||||
//TODO: parse location in body
|
//TODO: parse location in body
|
||||||
Location l = new() {
|
Location l = new() {
|
||||||
X = 0,
|
X = slot.Location.X,
|
||||||
Y = 0,
|
Y = slot.Location.Y,
|
||||||
};
|
};
|
||||||
this.database.Locations.Add(l);
|
this.database.Locations.Add(l);
|
||||||
await this.database.SaveChangesAsync();
|
await this.database.SaveChangesAsync();
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
|
using System.Xml.Serialization;
|
||||||
using LBPUnion.ProjectLighthouse.Serialization;
|
using LBPUnion.ProjectLighthouse.Serialization;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.Types.Profiles {
|
namespace LBPUnion.ProjectLighthouse.Types.Profiles {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The location of a slot on a planet.
|
/// The location of a slot on a planet.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlRoot("location"), XmlType("location")]
|
||||||
public class Location {
|
public class Location {
|
||||||
|
[XmlIgnore]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("x")]
|
||||||
public int X { get; set; }
|
public int X { get; set; }
|
||||||
|
|
||||||
|
[XmlElement("y")]
|
||||||
public int Y { get; set; }
|
public int Y { get; set; }
|
||||||
|
|
||||||
public string Serialize() {
|
public string Serialize() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue