Removed some redundant asserts/casts.

This commit is contained in:
Greg Edwards
2022-06-13 19:51:58 -04:00
parent 175d1670ac
commit a9723c573c
2 changed files with 6 additions and 8 deletions

View File

@@ -192,7 +192,7 @@ namespace PkmnFoundations.GTS
{
// No pokemon in the system
// what do here?
ShowError(context, 400);
ShowError(context, 403);
return;
}
else
@@ -502,11 +502,9 @@ namespace PkmnFoundations.GTS
AssertHelper.Assert(prevSession.Tag is GtsRecord4[]);
GtsRecord4[] tag = (GtsRecord4[])prevSession.Tag;
AssertHelper.Assert(tag.Length == 2);
AssertHelper.Assert(tag[0] is GtsRecord4);
AssertHelper.Assert(tag[0] is GtsRecord4);
GtsRecord4 upload = (GtsRecord4)tag[0];
GtsRecord4 result = (GtsRecord4)tag[1];
GtsRecord4 upload = tag[0];
GtsRecord4 result = tag[1];
if (Database.Instance.GtsTradePokemon4(upload, result, pid))
response.Write(new byte[] { 0x01, 0x00 }, 0, 2);

View File

@@ -133,7 +133,7 @@ namespace PkmnFoundations.GTS
// todo: we should probably repeat the previous record
// that was in here before delete.asp was called.
// That is... if we still had it. -__-;
ShowError(context, 400);
ShowError(context, 403);
return;
}
else
@@ -457,8 +457,8 @@ namespace PkmnFoundations.GTS
GtsRecord5[] tag = (GtsRecord5[])prevSession.Tag;
AssertHelper.Assert(tag.Length == 2);
GtsRecord5 upload = (GtsRecord5)tag[0];
GtsRecord5 result = (GtsRecord5)tag[1];
GtsRecord5 upload = tag[0];
GtsRecord5 result = tag[1];
if (Database.Instance.GtsTradePokemon5(upload, result, pid))
response.Write(new byte[] { 0x01, 0x00 }, 0, 2);