Fixed bug in AddRegion failing to completely add regions
An invalid SQL query selecting the region ID from the newly inserted region prevented the AddRegion method from completely adding a region, even though it was inserted into the database correctly, leading to a `false` result even though the region add was successful. This fixes /region define, and HouseRegions.
This commit is contained in:
parent
1bf703a6b0
commit
3d37f51290
1 changed files with 1 additions and 1 deletions
|
|
@ -140,7 +140,7 @@ namespace TShockAPI.DB
|
|||
"INSERT INTO Regions (X1, Y1, width, height, RegionName, WorldID, UserIds, Protected, Groups, Owner, Z) VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10);",
|
||||
tx, ty, width, height, regionname, worldid, "", 1, "", owner, z);
|
||||
int id;
|
||||
using (QueryResult res = database.QueryReader("SELECT Id FROM Regions WHERE RegionName = @0 AND WorldID = @1", regionname, worldid))
|
||||
using (QueryResult res = database.QueryReader("SELECT Id FROM Regions WHERE RegionName = '@0' AND WorldID = '@1'", regionname, worldid))
|
||||
{
|
||||
id = res.Get<int>("Id");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue