|
|
@ -229,7 +229,8 @@ impl EntityGateway for PostgresGateway { |
|
|
|
let mut stream = sqlx::query_as::<_, PgCharacter>("select * from player_character where user_account = $1 and slot < 4 order by slot")
|
|
|
|
.bind(user.id.0)
|
|
|
|
.fetch(&self.pool);
|
|
|
|
let mut result = [None; 4];
|
|
|
|
const NONE: Option<CharacterEntity> = None;
|
|
|
|
let mut result = [NONE; 4];
|
|
|
|
while let Some(character) = stream.try_next().await? {
|
|
|
|
let index = character.slot as usize;
|
|
|
|
result[index] = Some(character.into())
|
|
|
|